[16973] in Perl-Users-Digest
Perl-Users Digest, Issue: 4385 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 20 11:05:31 2000
Date: Wed, 20 Sep 2000 08:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <969462309-v9-i4385@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 20 Sep 2000 Volume: 9 Number: 4385
Today's topics:
Re: (OpenVMS) EOF with autoflushed file <coucoureux.p@fr.ibm.com>
Re: Archive File Attribute on NT (Gwyn Judd)
Re: Can you store a condition in a variable? <russ_jones@rac.ray.com>
Re: Candidate for the top ten perl mistakes list <russ_jones@rac.ray.com>
DB_File: PROBLEMS in porting perl script <paul@crocodile.iis.nsk.su>
Re: Gratuitous incompatibilities (Was: Re: Range operat <biow@verity.com>
Hash jelp for Newbie <flsq@home.com>
Re: Hash jelp for Newbie <mbudash@sonic.net>
Re: Hash jelp for Newbie <flsq@home.com>
Re: Hash jelp for Newbie <jeffp@crusoe.net>
Re: Hash jelp for Newbie <red_orc@my-deja.com>
Re: I need help with arrays. (Gwyn Judd)
Re: I need help with arrays. <russ_jones@rac.ray.com>
Re: I need help with arrays. <jeffp@crusoe.net>
Re: I need help with arrays. (Abigail)
Looking for perl sample to post to web site?? smithj@allnightprod.com
Re: MS-ACCESS <camerond@mail.uca.edu>
Perl Shell on Windows NT charlie.bursell@healthcare.com
Re: Pure perl encrypt/decryption? <camerond@mail.uca.edu>
Re: Q: about @ARGV and open on Windows dippy1568@my-deja.com
Re: reading from a file (Toffer)
Re: Searching text in hash/array or db file ? <uackermann@orga.com>
Re: Shortest code for Fibonacci? (Gwyn Judd)
Test - disregard this mesage from a newbie <tn@computas.no>
Re: Test - disregard this mesage from a newbie (Gwyn Judd)
Re: Test - disregard this mesage from a newbie <russ_jones@rac.ray.com>
Time help <rui.miguel@srd.alcatel.pt>
Re: Using range operator <mauldin@netstorm.net>
Re: Variable Handling (Gwyn Judd)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 20 Sep 2000 16:19:59 +0200
From: Pierre Coucoureux <coucoureux.p@fr.ibm.com>
Subject: Re: (OpenVMS) EOF with autoflushed file
Message-Id: <39C8C78E.2A4AC2D3@fr.ibm.com>
Dan Sugalski wrote:
>
> That's very odd. Could be any number of reasons, including a spurious
> error. What version of perl, and what version & architecture of VMS?
>
Perl 5.005_03 and OpenVMS 7.2.1 on Alpha
I have done some others tests to try to identify the problem
When my code is :
open LOG ,">foo.txt";
$oldfh = select LOG; $| = 1; select $oldfh;
print LOG "Hello" or print "Error $! writing to log\n";
close LOG;
I receive
Error end of file detected writing to log
BUT a line is written in the file.
If I delete the Line 2 (autoflush) or if I replace or by || in Line 3 All is
OK
I don't receive Error message and the line is written in the file.
So, I don't know if it's really a problem with the autoflush mode but I have
some difficulties to understand the difference between the 'or' and the '||'.
Thanks in advance if you have any idea that can help me to understand this
small
problem.
------------------------------
Date: Wed, 20 Sep 2000 13:55:09 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Archive File Attribute on NT
Message-Id: <slrn8shgdp.jg.tjla@thislove.dyndns.org>
I was shocked! How could tanya_ellis@my-deja.com <tanya_ellis@my-deja.com>
say such a terrible thing:
>> .. then take a guess which one of the Win32 modules might help you
>> find out about file attributes
>>
>> click on it and read the information on the right
>>
>> repeat process for any other questions before asking them here
>
>well by the sounds of it I must apologise for asking such a dumb
>question. I was always lead to believe that there are no dumb
>questions. I also believed that this site is a place to share knowledge
>not only between experts but those trying to learn perl. By the looks
>of it I am not only dumb but wrong!
It's like this, Perl comes with a whole bunch of documentation and for
womeone who is new to it, searching through it can be a bit daunting. On
the other hand it is easier for us to teach you now how to search for it
rather than simply give you the solution to all of your problems, this
saves us time and gives you knowledge that you will be able to apply in
your later quests for knowledge.
>But thank you jason for your "tip" - I had already found this. But
>oblivious I need more help! May be if the html documentation had more
>examples I would not have to correspond with the so called experts like
>you on this site!
Uhh, tanya, have you ever head the saying that starts "Give a man a
fish"? Your question was not dumb, on the other hand it is dumb to
offend the person who goes out of his way to help you as next time when
you have a difficult question he may not be in a mood to do so. We don't
mind "dumb" questions, actually most of us like helping out people who
are new to this sort of thing, but the whole thing about being a
programmer is that it is very much a "help yourself" kind of discipline.
To be a good programmer requires that you do a lot of stuff for
yourself, this includes being able to read and understand the available
documentation.
Programmers are also fundamentally lazy, therefore we don't like to do
more than we absolutely have to, therefore if it comes down to a choice
between telling you where in the documentation you can find the
solution, or telling you the solution we'd generally go for the second
if it means that in time you learn how to use the documentations and
only bother us with the hard (ie. interesting) questions that they don't
cover.
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
BOFH excuse #332:
suboptimal routing experience
------------------------------
Date: Wed, 20 Sep 2000 08:22:11 -0500
From: Russ Jones <russ_jones@rac.ray.com>
Subject: Re: Can you store a condition in a variable?
Message-Id: <39C8BA03.15D70FFD@rac.ray.com>
Jonathan Stowe wrote:
>
> On Tue, 19 Sep 2000 12:21:04 -0700 Larry Rosler wrote:
> > In article <slrn8sf5vb.5fq.abigail@alexandra.foad.org> on 19 Sep 2000
> > 16:45:37 GMT, Abigail <abigail@foad.org> says...
> >>
> >> (Yellow and green? *shudder*)
> >
> > Check out the Australiam team's colors. Also the University of Oregon
> > (Ducks!, how appropriate), But *shudder* anyway. :-)
> >
>
> Brazilian footbal team too.
How odd. The topic of how almost no sports teams had yellow as a
color, it was always gold, was raised in Frank DeFord's (sp?)
commentary today on Morning Edition on NPR. Virginia Military Academy
has a school color of yellow, too.
--
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747
Quae narravi, nullo modo negabo. - Catullus
------------------------------
Date: Wed, 20 Sep 2000 09:02:55 -0500
From: Russ Jones <russ_jones@rac.ray.com>
Subject: Re: Candidate for the top ten perl mistakes list
Message-Id: <39C8C38F.249B821B@rac.ray.com>
"Adrian Pepper [MFCF]" wrote:
>
> My candidate for the top ten perl mistakes list
>
1: didn't use -w
2: didn't use strict
3: didn't test the results of an "open"
4: listened to anything godzilla said
Ordering subject to change.
--
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747
Quae narravi, nullo modo negabo. - Catullus
------------------------------
Date: Wed, 20 Sep 2000 20:59:18 +0700
From: Paul Dortman <paul@crocodile.iis.nsk.su>
Subject: DB_File: PROBLEMS in porting perl script
Message-Id: <Pine.LNX.4.21.0009201701220.10179-100000@crocodile.iis.nsk.su>
Help! Help! Help!
I have working cgi script on perl5.00504 version. I want to port it to
server that has perl version perl5.00404. And I have that my script does
not work under perl of older version.
Let me give you part of my source code:
here if $something == 1 then program opens database for reading, and
if $somethingelse == 1 then program opens database for writing.
if ($something == 1) {
# Open database for reading
$his_db = tie(%his_db, 'DB_File',
"$dirname/messages/history.db", O_CREAT|O_RDONLY,0666);
unless ($his_db) {
$something = 0;
die ("Tie error !!!: $dirname/messages/history.db :$!"); }
$fd_his_db = $his_db->fd;
open(HIS_DB_FH, "<&=$fd_his_db") or die "dup: $dirname/messages/history.db $!";
unless (flock(HIS_DB_FH, LOCK_SH)) {
$something = 0;
die "can not get lock on file $dirname/messages/history.db
for reading: $!";
}
}
if ($somethingelse == 1) {
# Open database for writing
$his_db = tie(%his_db, 'DB_File', "$dirname/history.db", O_CREAT|O_RDWR, 0666);
unless ($his_db) {
$somethingelse = 0;
die ("Tie error !!!: $dirname/history.db: $!"); }
$fd_his_db = $his_db->fd;
open(HIS_DB_FH, "+<&=$fd_his_db");# or die "dup : $!";
unless (flock(HIS_DB_FH, LOCK_EX)) {
$somethingelse = 0;
die "can not get lock on file $dirname/history.db for
writing: $!";
}
}
As I said this code is working perfect well with perl5.00504 version. But
when I try to run this script under perl500404, the script could not
create normal database when I try to read the database. (In terms of this
source, when something == 1 and there is no database yet). In this case
the empty database is created (size of history.db == 0), and later the
script could not operate with it in any way
(I have error when try to "tie": 'Invalid argument at .... , <13> chunk 1>
If someone know, please help, what is difference between perl5.00504 and
perl5.00404 regarding DB_File module?
Or I do something wrong ? If so, what?
Did anyone have this problem ??
Please, help I really need your help.
Thank you for your help.
Paul Dortman
------------------------------
Date: Wed, 20 Sep 2000 09:29:09 -0400
From: Christopher Biow <biow@verity.com>
Subject: Re: Gratuitous incompatibilities (Was: Re: Range operator with "... /^$/")
Message-Id: <2eqfsssadffusi8a5rk8934mn3kkckik1g@4ax.com>
Larry Rosler <lr@hpl.hp.com> wrote:
>The Unix use of a single character to represent New Line was clever; the
>use of the character literally implementing Line Feed ("\12") instead of
>an otherwise unused control character led to confusion.
Perhaps LF was chosen for "safety" in that if a file was inadvertantly
dumped "raw" to an impact printer, it would not result in a pileup of
printing and burn through the paper and platen?
>Apple's choice of Carriage Return ("\15") for the same logical function
>compounded the confusion.
*Not* safe in that respect!
-
Yes, I can remember seeing
printouts that looked
like this
------------------------------
Date: Wed, 20 Sep 2000 13:16:48 GMT
From: Shawn and Francine <flsq@home.com>
Subject: Hash jelp for Newbie
Message-Id: <39F04521.72C94A0@home.com>
I have just begun to learn perl and have a question about hashes. Can
they be modified. I the codes snipet I have inluded I want to be able
to add more that one student record and then print out a specific record
based on the student number. The problem that I am having is that I am
only able to recall the last record inputed. Could someone please give
me a hand.
Thanks
while ($Choice != 4)
{ print "\n\nPlease Select an Option\n\n";
print "1. Enter More Student Data\n";
print "2. Display Info For a Student\n";
print "4. Exit\n\n";
print "Enter Your Choice: ";
$Choice = <STDIN>;
if ($Choice == 1)
{
print "\n\nPlease Enter Student Number: ";
$Number = <STDIN>;
print "\n\nPlease Enter Student Name: ";
$Name = <STDIN>;
%Info = (
$Number => $Name, #Am I missing
something here?
);
}
if ($Choice == 2)
{
print "\n\nPlease Enter Student's Number: ";
$Getinfo = <STDIN>;
print $Info{$Getinfo};
}
}
------------------------------
Date: Wed, 20 Sep 2000 06:32:52 -0700
From: Michael Budash <mbudash@sonic.net>
Subject: Re: Hash jelp for Newbie
Message-Id: <mbudash-21CDE0.06325220092000@news.pacbell.net>
In article <39F04521.72C94A0@home.com>, Shawn and Francine
<flsq@home.com> wrote:
> I have just begun to learn perl and have a question about hashes. Can
> they be modified. I the codes snipet I have inluded I want to be able
> to add more that one student record and then print out a specific record
> based on the student number. The problem that I am having is that I am
> only able to recall the last record inputed. Could someone please give
> me a hand.
>
> Thanks
>
> while ($Choice != 4)
> { print "\n\nPlease Select an Option\n\n";
> print "1. Enter More Student Data\n";
> print "2. Display Info For a Student\n";
> print "4. Exit\n\n";
> print "Enter Your Choice: ";
> $Choice = <STDIN>;
> if ($Choice == 1)
> {
> print "\n\nPlease Enter Student Number: ";
> $Number = <STDIN>;
> print "\n\nPlease Enter Student Name: ";
> $Name = <STDIN>;
> %Info = (
> $Number => $Name, #Am I missing
> something here?
> );
this line should read:
$Info{$Number} = $Name;
[snip]
hth -
--
Michael Budash ~~~~~~~~~~ mbudash@sonic.net
------------------------------
Date: Wed, 20 Sep 2000 13:59:10 GMT
From: Shawn and Francine <flsq@home.com>
Subject: Re: Hash jelp for Newbie
Message-Id: <39F04F0C.3C5830E5@home.com>
Michael Budash wrote:
> In article <39F04521.72C94A0@home.com>, Shawn and Francine
> <flsq@home.com> wrote:
>
> > I have just begun to learn perl and have a question about hashes. Can
> > they be modified. I the codes snipet I have inluded I want to be able
> > to add more that one student record and then print out a specific record
> > based on the student number. The problem that I am having is that I am
> > only able to recall the last record inputed. Could someone please give
> > me a hand.
> >
> > Thanks
> >
> > while ($Choice != 4)
> > { print "\n\nPlease Select an Option\n\n";
> > print "1. Enter More Student Data\n";
> > print "2. Display Info For a Student\n";
> > print "4. Exit\n\n";
> > print "Enter Your Choice: ";
> > $Choice = <STDIN>;
> > if ($Choice == 1)
> > {
> > print "\n\nPlease Enter Student Number: ";
> > $Number = <STDIN>;
> > print "\n\nPlease Enter Student Name: ";
> > $Name = <STDIN>;
> > %Info = (
> > $Number => $Name, #Am I missing
> > something here?
> > );
>
> this line should read:
>
> $Info{$Number} = $Name;
>
> [snip]
>
> hth -
> --
> Michael Budash ~~~~~~~~~~ mbudash@sonic.net
Ok thanks that worked, but doesn't that creat3 a scalar instead of a hash?
Can it be done using hashes?
------------------------------
Date: Wed, 20 Sep 2000 10:27:38 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: Hash jelp for Newbie
Message-Id: <Pine.GSO.4.21.0009201026060.15465-100000@crusoe.crusoe.net>
[posted & mailed]
On Sep 20, Shawn and Francine said:
>> > %Info = (
>> > $Number => $Name, #Am I missing
>> > something here?
>> > );
>>
>> this line should read:
>>
>> $Info{$Number} = $Name;
>
>Ok thanks that worked, but doesn't that creat3 a scalar instead of a hash?
>Can it be done using hashes?
No, it creates a key-value pair in the hash. You already know how to get
data OUT of the hash (since you did it in your program) and the syntax is
remarkably similar.
%hash = (...);
sets the ENTIRE hash. To set a single key-value pair, you say
$hash{$key} = $value;
and to get a value out of a hash, you do
$value = $hash{$key};
Read the 'perldata' documentation, or look at "Learning Perl" (2nd
ed) published by O'Reilly.
--
Jeff "japhy" Pinyan japhy@pobox.com http://www.pobox.com/~japhy/
PerlMonth - An Online Perl Magazine http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc. http://www.perlarchive.com/
CPAN - #1 Perl Resource (my id: PINYAN) http://search.cpan.org/
------------------------------
Date: Wed, 20 Sep 2000 14:19:06 GMT
From: Rodney Engdahl <red_orc@my-deja.com>
Subject: Re: Hash jelp for Newbie
Message-Id: <8qah04$ltp$1@nnrp1.deja.com>
In article <39F04F0C.3C5830E5@home.com>,
Shawn and Francine <flsq@home.com> wrote:
>
>
> Michael Budash wrote:
>
> > In article <39F04521.72C94A0@home.com>, Shawn and Francine
> > <flsq@home.com> wrote:
> >
> > > I have just begun to learn perl and have a question about hashes
> >
> > this line should read:
> >
> > $Info{$Number} = $Name;
> >
> > [snip]
> >
> > hth -
> > --
> > Michael Budash ~~~~~~~~~~ mbudash@sonic.net
>
> Ok thanks that worked, but doesn't that creat3 a scalar instead of a
> hash?
nope. that is how you ordinarily reference a single element of the
hash %Info, just as $Info[1] is ordinarily how you would reference the
second element of the array @Info.
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 20 Sep 2000 14:10:57 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: I need help with arrays.
Message-Id: <slrn8shhbe.jg.tjla@thislove.dyndns.org>
I was shocked! How could Abigail <abigail@foad.org>
say such a terrible thing:
>esalmon@packet.net (esalmon@packet.net) wrote on MMDLXXVII September
>MCMXCIII in <URL:news:39C8588B.43EB@packet.net>:
>// How would I find and delete duplicates from an array.
>
>Djee. You'd think that someone else might have had the same problem,
>and it might even have been answered frequently.
Who'd a thunk it?
>Anyway, here's a solution.
A better solution would work on arrays consisting of things other than
just integers.
>
> do {my ($x, $y) = int rand @array;
> do { $y = int rand @array} until $x <=> $y;
> $array [$y] <=> $array [$x] or
$array [$y] cmp $array [$x] or
> splice @array => rand > 0.5 ? $x : $y => 1
> } until do {
> my $magic = 7;
> for (my ($x, $y) = (0, 0); $x < $#array; $y = ++ $x) {
> $magic *= $array [$x] <=> $array [++ $y] until $y == $#array;
$magic *= $array [$x] cmp $array [++ $y] until $y == $#array;
> }
> $magic;
> };
>--
>perl -wlpe '}{$_=$.' file # Count the number of lines.
># A woodpecker nests.
># The King near the Shaolin
># temple. A cat prowls.
I love these little poems :) Are these generated by a program? If so,
care to share the code?
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
All the world's a stage and most of us are desperately unrehearsed.
-- Sean O'Casey
------------------------------
Date: Wed, 20 Sep 2000 09:16:55 -0500
From: Russ Jones <russ_jones@rac.ray.com>
Subject: Re: I need help with arrays.
Message-Id: <39C8C6D7.77D56D10@rac.ray.com>
Abigail wrote:
>
> Anyway, here's a solution.
>
>
> do {my ($x, $y) = int rand @array;
> do { $y = int rand @array} until $x <=> $y;
> $array [$y] <=> $array [$x] or
> splice @array => rand > 0.5 ? $x : $y => 1
> } until do {
> my $magic = 7;
> for (my ($x, $y) = (0, 0); $x < $#array; $y = ++ $x) {
> $magic *= $array [$x] <=> $array [++ $y] until $y == $#array;
> }
> $magic;
> };
>
She's not broken, but she's seriously bent! (this is more amazing than
most of her JAPH's)
Today my spell checker wants to turn "JAPH" to "jape" which in this
case I like pretty well!
--
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747
Quae narravi, nullo modo negabo. - Catullus
------------------------------
Date: Wed, 20 Sep 2000 10:25:31 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: I need help with arrays.
Message-Id: <Pine.GSO.4.21.0009201025110.15465-100000@crusoe.crusoe.net>
On Sep 20, Gwyn Judd said:
>># A woodpecker nests.
>># The King near the Shaolin
>># temple. A cat prowls.
>
>I love these little poems :) Are these generated by a program? If so,
>care to share the code?
Damian Conway wrote the module (of course). Coy.pm.
--
Jeff "japhy" Pinyan japhy@pobox.com http://www.pobox.com/~japhy/
PerlMonth - An Online Perl Magazine http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc. http://www.perlarchive.com/
CPAN - #1 Perl Resource (my id: PINYAN) http://search.cpan.org/
------------------------------
Date: 20 Sep 2000 14:38:40 GMT
From: abigail@foad.org (Abigail)
Subject: Re: I need help with arrays.
Message-Id: <slrn8shita.5fq.abigail@alexandra.foad.org>
Gwyn Judd (tjla@guvfybir.qlaqaf.bet) wrote on MMDLXXVII September
MCMXCIII in <URL:news:slrn8shhbe.jg.tjla@thislove.dyndns.org>:
:) I was shocked! How could Abigail <abigail@foad.org>
:) say such a terrible thing:
:)
:) >Anyway, here's a solution.
:)
:) A better solution would work on arrays consisting of things other than
:) just integers.
use overload;
(What's next, whining that a sort solution only works on strings?)
:) I love these little poems :) Are these generated by a program? If so,
:) care to share the code?
use Coy;
Abigail
--
perl -we 'print q{print q{print q{print q{print q{print q{print q{print q{print
qq{Just Another Perl Hacker\n}}}}}}}}}' |\
perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w
------------------------------
Date: Wed, 20 Sep 2000 13:51:48 GMT
From: smithj@allnightprod.com
Subject: Looking for perl sample to post to web site??
Message-Id: <8qafdb$k14$1@nnrp1.deja.com>
Looking for perl sample to post to web site??
Can anyone please email me some perl code that will do a post to a web
site??
smithj@statenislandonline.com
Thanks
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 20 Sep 2000 09:42:37 -0500
From: Cameron Dorey <camerond@mail.uca.edu>
Subject: Re: MS-ACCESS
Message-Id: <39C8CCDD.414425E@mail.uca.edu>
FNAC wrote:
>
> Where could I find any code example to open an MS-ACCESS database and update
> a record ?
Direct from the developer of the Win32::OLE module:
http://www.activestate.com/Products/ActivePerl/docs/site/lib/Win32/OLE/TPJ.html
Cameron
--
Cameron Dorey
Associate Professor of Chemistry
University of Central Arkansas
Phone: 501-450-5938
camerond@mail.uca.edu
------------------------------
Date: Wed, 20 Sep 2000 14:54:16 GMT
From: charlie.bursell@healthcare.com
Subject: Perl Shell on Windows NT
Message-Id: <8qaj2d$ong$1@nnrp1.deja.com>
I'm not much on Windows, but have recently been forced into it.
On Windows NT, it seems that perl runs in a sub-shell and not in the
active shell window. I note that I cannot redirect the standard output
of my perl scripts via ">" or "|".
For example, I create a one line perl script, myperl.pl, with the line,
print "Hello World\n".
If at the Windows shell prompt, I enter, myperl, I get Hello World as
expected. However if I enter, myperl > foo, I get no output from the
perl script and get a file named foo with nothing in it (0 bytes).
Is there a way to make a perl script in Windows NT run in the current
shell?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 20 Sep 2000 09:35:00 -0500
From: Cameron Dorey <camerond@mail.uca.edu>
Subject: Re: Pure perl encrypt/decryption?
Message-Id: <39C8CB14.DAC3849C@mail.uca.edu>
grymoire@my-deja.com wrote:
>
> I'm setting up a web page, and need an encryption (not hash) function
> that is in pure perl. My ISP doesn't want to install any
> external modules. I've looked at the perl modules but all the ones
> I've looked at use an external library.
>
> Is there a pure perl encryption/decryption routine someplace?
> This is for low volume data, so speed isn't important.
What would be the problem with you putting a module in your personal
space, if the ISP doesn't want to put it in the default path?
Cameron
--
Cameron Dorey
Associate Professor of Chemistry
University of Central Arkansas
Phone: 501-450-5938
camerond@mail.uca.edu
------------------------------
Date: Wed, 20 Sep 2000 14:08:08 GMT
From: dippy1568@my-deja.com
Subject: Re: Q: about @ARGV and open on Windows
Message-Id: <8qagbo$l5n$1@nnrp1.deja.com>
just use " " on your arguement so far as the command line thing goes.
perl.exe test.pl "Hello World"
print $ARGV[0] # Prints Hello World (without the quotes)
I'm not sure if you can open paths/files with blanks, but when you try
it if you could please let me know..it'd be a good thing to know, and
save me the time of trying it.
marc
In article <8qa44h$6vi$1@nnrp1.deja.com>,
SANFACE Software <sanface@sanface.com> wrote:
> I'd like to pass like input parameter to a script on Windows a file
with
> inside the path a blank and use inside the script like a true file
(open
> it, write it, close it, ...)
> e.g. c:\this is the directory\myfile.txt
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 20 Sep 2000 14:31:16 GMT
From: toffer@fake.email.co.uk (Toffer)
Subject: Re: reading from a file
Message-Id: <39c8c9b2.3092504495@news.dircon.co.uk>
I would use chop, thusly..
$a = <FILE>;
chop($a);
Chris
Powlow <powlow@my-deja.com> wrote:
>hey,
>
>reading two lines from a text file,
>
>open(USERFILE,$namein); # open file for reading # lock file here $eatit =
><USERFILE>; # reads first line of USERFILE into variable $mess = <USERFILE>;
> # reads next line of USERFILE into variable close(USERFILE); # close
>file
>
>$eatit and $mess have what looks to me like a space (in html) or a newline
>(in unix shell) as the last character. i've tried doing all sorts of
>substitutions assuming its a space or a newline. i've also used chomp. none
>of these seem to work. am i missing something? is there a way to do this
>other than adding a space on the end of what i'm comparing them to?
>
>can someone please post something as this is really frustrating and i can't
>see any obvious solution, being new to perl. -paulo
>___________________________ http://powlow.com/ ___________________________
>
>--
>___________________________
> http://powlow.com/
>___________________________
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.
------------------------------
Date: Wed, 20 Sep 2000 15:05:17 +0200
From: Ulrich Ackermann <uackermann@orga.com>
Subject: Re: Searching text in hash/array or db file ?
Message-Id: <39C8B60D.264672B0@orga.com>
Ed Bras wrote:
>
> I have a lists of words stored in a array (contains 3000 and more words) and
> check if a word exist.
> I do that now through a while loop.
>
> I like to know if this can be done in a faster way, as speed in this case is
> rather important.
> I was thinking about putting the words in a hash table as a key, or putting
> them in a db file ?
>
> Can someone please tell me what the best method is to get high performance
> when searching a word ??
>
> Regards,
> Ed Bras
perldoc perlfaq4
Search for:
How can I tell whether a list or array contains a certain element?
HTH, Ulrich
--
Ulrich Ackermann
ORGA Kartensysteme GmbH (SY-PEAT-STA)
Tel.:+49.5254.991-925
mailto:uackermann@orga.com
------------------------------
Date: Wed, 20 Sep 2000 13:35:32 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Shortest code for Fibonacci?
Message-Id: <slrn8shf90.jg.tjla@thislove.dyndns.org>
I was shocked! How could Bart Lateur <bart.lateur@skynet.be>
say such a terrible thing:
>Gwyn Judd wrote:
>
>>On the other hand, in general it is not possible to
>>raise powers of arbitrary real numbers in constant time.
>
>Eh? I thought that the function
>
> exp($y*log($x))
>
>(but with base 2, not e)
>
>was the basis for powers $x**$y of arbitry numbers ($x is positive)?
>That must be pretty much in constant time, or at least, in reasonable
>time?
How do you take a log in constant time? Of *any* real number. Not of
some subset where you can cheat and do a table lookup?
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Those who in quarrels interpose, must often wipe a bloody nose.
------------------------------
Date: Wed, 20 Sep 2000 13:15:20 GMT
From: "Thor Nylander" <tn@computas.no>
Subject: Test - disregard this mesage from a newbie
Message-Id: <969455720.411950@mulen.computas.no>
I'm just trying to check if this newsreader will allow me to post.
------------------------------
Date: Wed, 20 Sep 2000 14:29:25 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Test - disregard this mesage from a newbie
Message-Id: <slrn8shie2.jg.tjla@thislove.dyndns.org>
I was shocked! How could Thor Nylander <tn@computas.no>
say such a terrible thing:
>I'm just trying to check if this newsreader will allow me to post.
There are better places for this (Hint: any newsgroup with the word
"test" in it's name). Don't do this again.
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Love is a great beautifier.
-- Louisa May Alcott
------------------------------
Date: Wed, 20 Sep 2000 09:22:29 -0500
From: Russ Jones <russ_jones@rac.ray.com>
Subject: Re: Test - disregard this mesage from a newbie
Message-Id: <39C8C825.B375AA0F@rac.ray.com>
Thor Nylander wrote:
>
> I'm just trying to check if this newsreader will allow me to post.
It did, and mine allows me to ignore you. plonk.
--
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747
Quae narravi, nullo modo negabo. - Catullus
------------------------------
Date: Wed, 20 Sep 2000 14:54:30 +0100
From: Rui Miguel Venancio <rui.miguel@srd.alcatel.pt>
Subject: Time help
Message-Id: <39C8C196.6B512161@srd.alcatel.pt>
Hello,
I'm having some problems with the time conversion.
I need to do the following:
I have one variable with the system date (eg. 20000919 - YYYYMMDD),
And I have another variable with a date in the future
(eg: 20001005 - YYYYMMDD).
I want to see a message if the second date have less than 4 weeks of
the first date !!!!
Please help me ... I'm desperate with this.
Thanks and best regards
Rui Venancio
PS. Sorry for my bad english
------------------------------
Date: Wed, 20 Sep 2000 11:27:52 GMT
From: Jim Mauldin <mauldin@netstorm.net>
Subject: Re: Using range operator
Message-Id: <39C8C44F.8BEDDE2E@netstorm.net>
Randy wrote:
>
> Is there a simple way to use the range operator to check if a value
> falls within?
>
> Something like:
>
> $num=5;
> print "In range\n" if ($num == (1..20));
[ducks argument]
Although $num >= 1 && $num <= 20 is the best test, on the off-chance
that the OP was interested in discovering a Perl-ish construct more than
bulletproof code, you could, with appropriate assumptions, do:
print "In range\n" if (1..20)[$num-1];
perl doesn't complain with -w if $num is out of range, although it does
if you try:
print "In range\n" if (1..20)[$num-1]==$num;.
-- Jim
------------------------------
Date: Wed, 20 Sep 2000 14:27:11 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Variable Handling
Message-Id: <slrn8shi9s.jg.tjla@thislove.dyndns.org>
I was shocked! How could nobull@mail.com <nobull@mail.com>
say such a terrible thing:
>mmonti@cswe.org (M. Monti) writes:
>
>> I'm a beginner
>
>Standard beginner advice:
> Use only books/tutorials about Perl5 not ones about Perl4.
Strictly speaking, any book which mentions "Perl5" is ancient nowadays.
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
The fiercest enemy is the man who has nothing more to lose.
-"The X-Files"
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 4385
**************************************