[11560] in Perl-Users-Digest
Perl-Users Digest, Issue: 5160 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Mar 17 19:17:41 1999
Date: Wed, 17 Mar 99 16:00:23 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 17 Mar 1999 Volume: 8 Number: 5160
Today's topics:
Re: About CGI.pm (brian d foy)
argument parsing w/ getopts (Christian M. Aranda)
Change userid in mid-script <cw@dwc.ch>
echo pwd mr_potato_head@my-dejanews.com
Re: flock() on Alpha/VMS <sugalskd@netserve.ous.edu>
Re: flock() on Alpha/VMS <techno@umbriel.demon.co.uk>
Re: how do I wildcard within eq '***' ? (William Totten)
How to #! in Win95? (Valter Cunha)
Re: Install ActivePerl? <newsgroups@kidkaboom.frogspace.net>
Re: localtime (Larry Rosler)
mod_perl DBI error. daniel_zuck@non-hp-sunnyvale-om1.om.hp.com
Re: Need a one liner... benbean@yahoo.com
Re: Need a one liner... <jeffp@crusoe.net>
Re: Need a one liner... <benbean@yahoo.com>
Re: need perl script to check if web sites are up <jbc@shell2.la.best.com>
Net::POP3;login method returns 0 with messages on serve <snetvil@email.msn.com>
Newbe here again... <rcj@lucent.com>
Re: Newbe here again... (Alastair)
Re: Newbe here again... <klch@hknet.com>
Re: Newbe here again... <jglascoe@giss.nasa.gov>
Re: number convert <cassell@mail.cor.epa.gov>
Perl 5.00404 installation in Solaris2.6 (Wendy Lam)
Re: Perl acting different when run as CGI? (David Salvador Flores)
Perl and date comparisons <brownpatrick@lucent.com>
Re: perl and y2k (was Re: The millennium cometh -- even (Joonas Timo Taavetti Kekoni)
Perl executable <swamib@netscape.com>
Re: Public Key Encryption? (brian d foy)
PWS and Perl (Robby Boey)
Re: recode anyone? <mostynm@gromit.ecr.mu.oz.au>
Regular Expression Help <gala@sonic.net>
Re: rmdir fails Why? <support@counter.w-dt.com>
Re: rmdir fails Why? (brian d foy)
Re: Server doesnt recognize my .pl files (Alastair)
Re: unlink problem <Tony.Curtis@vcpc.univie.ac.at>
Where to find Perl spel checker defaultuser@domain.com
Re: Which OS am I in <cassell@mail.cor.epa.gov>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 17 Mar 1999 17:42:43 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: About CGI.pm
Message-Id: <comdog-ya02408000R1703991742430001@news.panix.com>
In article <36EFFCF3.B4BDE6B6@mailcity.com>, Kent Wang <kentwang@mailcity.com> posted:
> Just how efficient is CGI.pm? Are there alternatives?
there is CGI::Request. i don't use CGI.pm because i think it's
bloated and slow. that's just my opinion though.
> What's up with
> LWP?
in what context?
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Wed, 17 Mar 1999 23:52:05 GMT
From: christianarandaOUT@OUTyahoo.com (Christian M. Aranda)
Subject: argument parsing w/ getopts
Message-Id: <36f03ee3.20681137@news.bmc.com>
Folks -
I have done some simple command line argument parsing by hand (@ARGV),
and also some simple argument parsing with use Getopt::Std. Now, I am
trying to do argument parsing on a very large scale and am looking for
clean ways to implement it.
I plan on writing a seperate sub for the parsing of the args, but
don't know exactly how to handle missing arguments, creating mandatory
arguments, help text, usage text, etc.
If anyone has good examples of parsing command line arguments, please
post them here so I can get some ideas.
TIA -
Christian M. Aranda
------------------------------
Date: Wed, 17 Mar 1999 19:34:21 +0100
From: Christoph Wernli <cw@dwc.ch>
Subject: Change userid in mid-script
Message-Id: <36EFF5AD.573D0EF2@dwc.ch>
Hi,
I'ld appreciate any pointers/hints on how to change the userid the
script is executing under in the middle of the script (this is on Linux,
but Solaris will be next). It would be very nice to avoid either
system("su -c ...") or wrapping a shell-script around the various parts
of the program.
Thanks,
-Christoph
P.S: The background is: I want to selectively copy some files; some of
the directories in which they reside have permissions that don't even
allow root read-access, therefore changing uid seems the right answer.
------------------------------
Date: Wed, 17 Mar 1999 23:27:17 GMT
From: mr_potato_head@my-dejanews.com
Subject: echo pwd
Message-Id: <7cpdoa$asa$1@nnrp1.dejanews.com>
Hi,
I need to echo the working directory to the screen and I tried using
$directory = `pwd`;
print "$directory\n";
But this doesn't work. Any ideas? Thanks in advance...
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 17 Mar 1999 22:04:31 GMT
From: Dan Sugalski <sugalskd@netserve.ous.edu>
Subject: Re: flock() on Alpha/VMS
Message-Id: <7cp8tf$6i7$1@news.NERO.NET>
In comp.lang.perl.misc M.J.T. Guy <mjtg@cus.cam.ac.uk> wrote:
: Dan Sugalski <sugalskd@netserve.ous.edu> wrote:
:>
:>The VMS port of perl doesn't support flock or fcntl at the moment.
:>However... VMS has mandatory file locking--if you open a file for write,
:>nobody else will be able to. (The open call will throw an error) You'll
:>need a bit more checking on open to detect a locked file error, but you
:>can skip flock entirely on VMS.
: Wouldn't it be politer, and assist portability, if flock() was implemented
: as a no-op on this platform, since that is what it effectively is with
: mandatory locking?
It'd be politer, but it'd also be wrong. If you open a file
read-regardless (which doesn't place any locks on the file), flock(LOCKEX)
(or whatever the constant is) would return true even though it failed. And
flock(UNLOCK) on a file opened for write would return true even though it
didn't do that. The only really good way to handle it would be to have
flock check the current open mode and return true or false if it matched
what's being asked for. (Maybe for 5.006....)
Dan
------------------------------
Date: Wed, 17 Mar 1999 17:41:44 -0500
From: "Techno" <techno@umbriel.demon.co.uk>
Subject: Re: flock() on Alpha/VMS
Message-Id: <7cpb3a$129c$1@newssvr04-int.news.prodigy.com>
M.J.T. Guy wrote in message <7coqac$610$1@pegasus.csx.cam.ac.uk>...
>Dan Sugalski <sugalskd@netserve.ous.edu> wrote:
>>
>>The VMS port of perl doesn't support flock or fcntl at the moment.
>>However... VMS has mandatory file locking--if you open a file for write,
>>nobody else will be able to. (The open call will throw an error) You'll
>>need a bit more checking on open to detect a locked file error, but you
>>can skip flock entirely on VMS.
>
>Wouldn't it be politer, and assist portability, if flock() was implemented
>as a no-op on this platform, since that is what it effectively is with
>mandatory locking?
>
>
>Mike Guy
Mike,
I couldn't agree more, especially as the error returned by flock() in $! is
'no more processes'. This set me and my VMS admin guy off on a red-herring
hunt as we couldn't see any problems with the way the account was set up !!
Techno.
------------------------------
Date: 17 Mar 1999 22:03:51 GMT
From: totten @ cis . udel . edu (William Totten)
Subject: Re: how do I wildcard within eq '***' ?
Message-Id: <7cp8s7$qut$1@dewey.udel.edu>
In article <1do0gto.18rt9ui13qbyndN@bay2-167.quincy.ziplink.net>,
Ronald J Kimball <rjk@linguist.dartmouth.edu> wrote:
>Mig <mig@isis.ie> wrote:
>
>> I've replaced it with the line you suggested below and ran 'perl -c' on the
>> file. It gives the error "/.*?\.aol$/: nested *?+ in regexp at line blah" .
>> Is there something slightly amiss here?
>
>Yes. You're using perl4. Time to upgrade!
True, however there is still hope inside perl4.
Make this your expression:
if($ENV{REMOTE_HOST}=~m/.*\.aol\.com/) { ... }
Although non-greedy RE's are useful, they are not necessary here.
--
Totten, William David (Bill) Computer and Information Sciences
totten @ pobox . com University of Delaware (Newark, DE; USA)
http://pobox.com/~totten/ Friends don't let friends use emacs
------------------------------
Date: Wed, 17 Mar 1999 22:53:04 GMT
From: np49fn@mail.telepac.pt (Valter Cunha)
Subject: How to #! in Win95?
Message-Id: <36f03235.9102999@news.telepac.pt>
First of all, i want to say im a university student trying to learn
scripting Perl by myself, with the help of several books. Right now i
have one problem: all the books i read about Perl focus the scripting
of Perl under Unix, but what about under Win95? Well, let us say i
have a script called "test.pl" in the directory cgi-bin, and my perl
interpreter file "perl.exe" is in the same directory... My problem is,
im my html file, i have the following instruction:
<IMG SRC="cgi-bin\test.pl">
and on my Perl script i start with the instruction "#!\cgi-bin\perl"
the thing is... I cant get the script to get started... I even read
the FAQ at www.perl.com, and they say "The Win95/NT installation, when
using the Activeware port of Perl, will modify the Registry to
associate the .pl extension with the perl interpreter. If you install
another port, or (eventually) build
your own Win95/NT Perl using WinGCC, then you'll have to modify the
Registry yourself." Im novice at registry... Can someone help me?
Thanxs
Valter Cunha
Abducted@mail.telepac.pt
------------------------------
Date: Wed, 17 Mar 1999 23:09:16 GMT
From: "Theodore" <newsgroups@kidkaboom.frogspace.net>
Subject: Re: Install ActivePerl?
Message-Id: <36f0365f.0@news3.escape.ca>
Yes, ActivePerl 509 is better than build 315. I just downloaded it myself.
I just un-installed 316 then re-installed 509 over it... it comes with lots
of better things, and is perl version 5.005_02 (the newest version)
>From Theodore
Michael Stevens wrote in message ...
>Hi, I'm a Window95 user just starting with Perl. I have Perl for Win32
>build 315 installed on my computer. I have noticed a download from
>Activestate called ActivePerl. Could someone tell me if this would be
>better than my current installation? I know it comes with more tools but
>I'm not sure what they all do.
>
>If I do install ActivePerl do I need to uninstall my current interpreter
>first?
>--
>Michael Stevens
>michaelx59@hotmail.com
------------------------------
Date: Sat, 13 Mar 1999 22:01:56 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: localtime
Message-Id: <MPG.1154f0acd340cdc98973d@nntp.hpl.hp.com>
[Posted and a courtesy copy sent.]
In article <7cfgsk$sq5$1@nnrp1.dejanews.com> on Sun, 14 Mar 1999
05:19:21 GMT, Jennifer <webmaster@momsathome.on.ca >says...
> Could someone tell me what the last element in localtime is?
Sure. It isn't described other than $isdst in the Perl documentation,
but the ANSI/ISO C Standard tells more. I don't have my copy at home,
but I know this one pretty well.
+1 = Daylight Savings Time (Summer Time) is in effect.
0 = Daylight Savings Time (Summer Time) is not in effect.
-1 = I dunno.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personl/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 17 Mar 1999 23:35:00 GMT
From: daniel_zuck@non-hp-sunnyvale-om1.om.hp.com
Subject: mod_perl DBI error.
Message-Id: <7cpe73$b8l$1@nnrp1.dejanews.com>
I get an error "Can't locate auto/DBI/connect.al in @INC" when I try to
run a program using DBI; use DBI; (appear to be OK), I get the error on
the $dbh=DBI->connect(..);
Apache 1.3.4
DBI 1.06
mod_perl 1.18
perl 5.004_04
my mod_perl make: Makefile.PL DO_HTTPD=1 ALL_HOOKS=1 PERL_STACKED_HANDLERS=1
I'm new to mod_perl, sorry for any obvious ignorance.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 17 Mar 1999 22:48:43 GMT
From: benbean@yahoo.com
Subject: Re: Need a one liner...
Message-Id: <fjWH2.6521$SZ5.4078@news.rdc1.tx.home.com>
What is that ".." notation in the regular expression? I haven't seen that before
and I can't find mention of it in the books or man pages other than as used in a
field separator to denote any two characters.
Thanks.
evil Japh <jeffp@crusoe.net> wrote:
> There was an error in my previous post.
> perl -ne 'print if s/^START\n$/ .. s/^END\n$/' testfile
> SHOULD have been:
> perl -ne 'print if s/^START\n$// .. s/^END\n$//' testfile
> --
> Jeff Pinyan (jeffp@crusoe.net)
> www.crusoe.net/~jeffp
> Crusoe Communications, Inc.
> 973-882-1022
> www.crusoe.net
------------------------------
Date: Wed, 17 Mar 1999 17:58:49 -0500
From: evil Japh <jeffp@crusoe.net>
Subject: Re: Need a one liner...
Message-Id: <Pine.GSO.3.96.990317175646.9752E-100000@crusoe.crusoe.net>
> What is that ".." notation in the regular expression? I haven't seen that before
> and I can't find mention of it in the books or man pages other than as used in a
> field separator to denote any two characters.
> > perl -ne 'print if s/^START\n$// .. s/^END\n$//' testfile
It is the flip-flop operator, discussed in:
% perldoc perlop
In a scalar context, ".." returns a boolean value. The
operator is bistable, like a flip-flop, and emulates the
line-range (comma) operator of sed, awk, and various
editors. Each ".." operator maintains its own boolean
state. It is false as long as its left operand is false.
Once the left operand is true, the range operator stays true
until the right operand is true, AFTER which the range
operator becomes false again. (It doesn't become false till
the next time the range operator is evaluated. It can test
the right operand and become false on the same evaluation it
became true (as in awk), but it still returns true once.
It is not in the regular expression, it is a separate operator.
--
Jeff Pinyan (jeffp@crusoe.net)
www.crusoe.net/~jeffp
Crusoe Communications, Inc.
973-882-1022
www.crusoe.net
------------------------------
Date: Wed, 17 Mar 1999 23:35:27 GMT
From: Benjamin Smith <benbean@yahoo.com>
Subject: Re: Need a one liner...
Message-Id: <36F03C3F.E52A6C3F@yahoo.com>
Aha! I was just looking in the wrong place. Thanks!
evil Japh wrote:
>
> > What is that ".." notation in the regular expression? I haven't seen that before
> > and I can't find mention of it in the books or man pages other than as used in a
> > field separator to denote any two characters.
>
> > > perl -ne 'print if s/^START\n$// .. s/^END\n$//' testfile
>
> It is the flip-flop operator, discussed in:
> % perldoc perlop
>
> In a scalar context, ".." returns a boolean value. The
> operator is bistable, like a flip-flop, and emulates the
> line-range (comma) operator of sed, awk, and various
> editors. Each ".." operator maintains its own boolean
> state. It is false as long as its left operand is false.
> Once the left operand is true, the range operator stays true
> until the right operand is true, AFTER which the range
> operator becomes false again. (It doesn't become false till
> the next time the range operator is evaluated. It can test
> the right operand and become false on the same evaluation it
> became true (as in awk), but it still returns true once.
>
> It is not in the regular expression, it is a separate operator.
>
> --
> Jeff Pinyan (jeffp@crusoe.net)
> www.crusoe.net/~jeffp
>
> Crusoe Communications, Inc.
> 973-882-1022
> www.crusoe.net
------------------------------
Date: 17 Mar 1999 22:04:37 GMT
From: John Callender <jbc@shell2.la.best.com>
Subject: Re: need perl script to check if web sites are up
Message-Id: <36f026f5$0$205@nntp1.ba.best.com>
Tony Curtis <Tony.Curtis@vcpc.univie.ac.at> wrote:
> The LWP modules are probably what you want,
In terms of working examples, you could also try Randal's WebTechniques
columns, at:
http://www.stonehenge.com/merlyn/WebTechniques/
Specifically, the following give increasingly featureful link checkers:
http://www.stonehenge.com/merlyn/WebTechniques/col07.html
http://www.stonehenge.com/merlyn/WebTechniques/col14.html
http://www.stonehenge.com/merlyn/WebTechniques/col27.html
http://www.stonehenge.com/merlyn/WebTechniques/col35.html
--
John Callender
jbc@west.net
http://www.west.net/~jbc/
------------------------------
Date: Wed, 17 Mar 1999 17:58:52 -0600
From: "Scott" <snetvil@email.msn.com>
Subject: Net::POP3;login method returns 0 with messages on server
Message-Id: <eMB##GNc#GA.247@upnetnews02.moswest.msn.net>
I'm using the Net::POP3 module to check mail successfully but, when I try to
check the return value for the login method, I always get a '0'. The
documentation states that login returns the number of messages on the
server. As I stated above, I have no problems logging into my pop3 server
and downloading messages but, I always get a '0' from login. Am I
misunderstanding something or is my implementation wrong?
Code snippet:
BEGIN{use Net::POP3;
}
$pop=Net::POP3->new('pop.someserver.com',timeout=>30);
if(!defined $pop)
print "Couldn't establish connection!\n";
exit(0);
}
$l=$pop->login("userid","password");
print "$l\n"
Any help is appreciated. I'm using the ActiveState build 509 of Perl
5.005_02 on Windows 95. (I haven't checked to see if the same thing occurs
under Unix).
Thanks,
Scott
Please email courtesy copy of any replies.
------------------------------
Date: Wed, 17 Mar 1999 16:47:40 -0600
From: "Raymond C. Jender" <rcj@lucent.com>
Subject: Newbe here again...
Message-Id: <36F0310C.9E9BD91E@lucent.com>
Ok, so far so good. At least I'm progressing on my
little Perl project.
I have been checking FAQ and manuals but tell me,
is it me or are the available Perl docs kind of
ambiguous? Seems so to me.
Anyway, here's a simple thing that I can't seem to find
a way to do it.
All I want to do is check a digit string and reject it
if it contains something other then digits. The digit string
can be up to 10 digits long. Only 0-9 is allowed in the
string. Comments?
Thank you.
------------------------------
Date: Wed, 17 Mar 1999 23:25:49 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Newbe here again...
Message-Id: <slrn7f0ejn.5j.alastair@calliope.demon.co.uk>
Raymond C. Jender <rcj@lucent.com> wrote:
>I have been checking FAQ and manuals but tell me,
>is it me or are the available Perl docs kind of
>ambiguous? Seems so to me.
I guess an example would help.
>All I want to do is check a digit string and reject it
>if it contains something other then digits.
That's a FAQ.
perlfaq4 ;
How do I determine whether a scalar is a number/whole/integer/float?
HTH.
--
Alastair
work : alastair@psoft.co.uk
home : alastair@calliope.demon.co.uk
------------------------------
Date: Thu, 18 Mar 1999 07:59:49 +0800
From: Kenneth Lee <klch@hknet.com>
To: "Raymond C. Jender" <rcj@lucent.com>
Subject: Re: Newbe here again...
Message-Id: <36F041F5.F76CFE1B@hknet.com>
"Raymond C. Jender" wrote:
>
> Ok, so far so good. At least I'm progressing on my
> little Perl project.
>
> I have been checking FAQ and manuals but tell me,
> is it me or are the available Perl docs kind of
> ambiguous? Seems so to me.
>
> Anyway, here's a simple thing that I can't seem to find
> a way to do it.
>
> All I want to do is check a digit string and reject it
> if it contains something other then digits. The digit string
> can be up to 10 digits long. Only 0-9 is allowed in the
> string. Comments?
>
> Thank you.
if ( $digit_string =~ /^\d{0,10)$/ ) { # 0 to 10 digits
# match
} else {
# not match
}
------------------------------
Date: Wed, 17 Mar 1999 18:55:30 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: "Raymond C. Jender" <rcj@lucent.com>
Subject: Re: Newbe here again...
Message-Id: <36F040F2.20032224@giss.nasa.gov>
[courtesy copy of post sent to cited author]
"Raymond C. Jender" wrote:
>
> I have been checking FAQ and manuals but tell me,
> is it me or are the available Perl docs kind of
> ambiguous? Seems so to me.
Hmm. Many Perl operators are ambiguous in the sense
that they mean one thing in list context and quite
another in scalar context. Parentheses can be magical
sometimes, but sometimes it's only for grouping...
Perhaps the omnipresent TMTOWTDI could be construed
as ambiguous... ??
> All I want to do is check a digit string and reject it
> if it contains something other then digits. The digit string
> can be up to 10 digits long. Only 0-9 is allowed in the
> string. Comments?
yes: get thee to a bookstore! buy any two O'Reilly books with
the word "Perl" in the title.
ahem. Now to answer your question:
print "Narf! not a number." if $string =~ /\D/;
but you may want to "chomp()" your "$string" first.
Jay Glascoe
--
"Soup on all fours?"
"Of course. Whaddaya think, Soup is a biped?" - mst3k
------------------------------
Date: Wed, 17 Mar 1999 14:15:09 -0800
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: number convert
Message-Id: <36F0296D.83FEE6F8@mail.cor.epa.gov>
Kent Wang wrote:
> how about:
> $number = 123.345;
> $number = int($number * 100 + .5) / 100;
> Kent Wang
>
> Cplee wrote:
> > Dear Netter
> > I would like to convert $numbe=123.345 to $dollars=123.35
> > what is the command I can use
It would really be better to use the method suggested by other
posters. Read the Perl FAQ, in particular, perlfaq4, to see
that there is also a caveat about doing financial computations
like this without considering the ramifications.
David
--
David L. Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 17 Mar 1999 23:07:30 GMT
From: wlam@gpu.srv.ualberta.ca (Wendy Lam)
Subject: Perl 5.00404 installation in Solaris2.6
Message-Id: <7cpcji$7he$1@pulp.ucs.ualberta.ca>
Hi,
I'm trying to install Perl 5.00404 in Solaris 2.6, the following message
occurs:
gcc -L/usr/local/lib -L/usr/gnu/lib -L/opt/gnu/lib -o perl perlmain.o
lib/auto
/DynaLoader/DynaLoader.a lib/auto/Fcntl/Fcntl.a lib/auto/IO/IO.a
lib/auto/NDBM_F
ile/NDBM_File.a lib/auto/Opcode/Opcode.a lib/auto/POSIX/POSIX.a
lib/auto/SDBM_Fi
le/SDBM_File.a libperl.a `cat ext.libs` -lsocket -lnsl -lm
ld: fatal: library -ldbm: not found
ld: fatal: library -ldbm: not found
ld: fatal: File processing errors. No output written to perl
make: *** [perl] Error 1
Would anybody be able to tell me what went wrong? Thanks in advance!
Wendy
------------------------------
Date: 17 Mar 1999 23:13:11 GMT
From: dsf3g@node11.unix.Virginia.EDU (David Salvador Flores)
Subject: Re: Perl acting different when run as CGI?
Message-Id: <7cpcu7$3rj$1@murdoch.acc.Virginia.EDU>
In article <comdog-ya02408000R1203992053090001@news.panix.com>,
brian d foy <comdog@computerdog.com> wrote:
>In article <36E9B0EC.C4C58EFF@giss.nasa.gov>, jglascoe@giss.nasa.gov posted:
>
>> Andy Wallace wrote:
>
>> > # Get the list of filenames...
>> > #
>> > # opendir(THISDIR, "../images");
>> > opendir(THISDIR, "/home/andyw/public_html/images");
>>
>> Check the return value of all system calls ("opendir" is
>> a system call). I suspect the browser, "nobody", doesn't
>> have read access to "/home/andyw/public_html/images".
>
>and don't use relative paths. the default working directory may
>change with envrionments.
Yeah, check to see whether your system uses something like
CGI-Wrap. The systems here at UVA do, and this proved a
HUGE headache when I was trying to learn Perl and CGI on my
own! With CGI-wrap installed your pathnames can become quite
monstruous, and scripts have to be called through cgi-wrap.
I don't know that I can describe the specifics with any authority,
as I learned by picking apart existing scripts and seeing how
they worked. Still, there are web references that describe
CGI-wrap in detail, if that proves to be the problem.
-Dave
------------------------------
Date: Wed, 17 Mar 1999 15:14:23 -0700
From: "Pat Brown" <brownpatrick@lucent.com>
Subject: Perl and date comparisons
Message-Id: <7cp9h2$599@nntpa.cb.lucent.com>
I have a txt file that contains a headline and a date (ie.
headline;07/01/99)
I want to show this headline until I have reached the end date. I am
reading this file with Perl - how do I compare today's date to the string
(containing a date) to see the diff?
------------------------------
Date: 17 Mar 1999 22:44:08 GMT
From: jkekoni@cc.hut.fi (Joonas Timo Taavetti Kekoni)
Subject: Re: perl and y2k (was Re: The millennium cometh -- eventually)
Message-Id: <7cpb7o$9vs$1@nntp.hut.fi>
Russell Schulz (Russell_Schulz@locutus.ofB.ORG) wrote:
: again: this is why I disagree with the FAQ. I have never seen a pencil
: that would surprise a user (who, shockingly, hadn't memorized its manual)
: by writing 100 when referring to 2000.
NO. 107 years old people have been asked for scool before times of
computers.
--
_- Joonas Kekoni OH2MTF I -_
_-internet: jkekoni@cc.hut.fi I DO NOT EAT. -_
_-slowmail: j{mer{ntaival 7a176 I -_
_- 02150Espoo I It is a monitor -_
_- Finland/Europe I -_
------------------------------
Date: Wed, 17 Mar 1999 15:13:42 -0800
From: Swaminathan Balasubramanian <swamib@netscape.com>
Subject: Perl executable
Message-Id: <36F03726.9443A3B9@netscape.com>
Is there any tool to compile the perl source to Unix executable.?. Will
it run faster than running source code directly?
Thanks
Swami
------------------------------
Date: Wed, 17 Mar 1999 17:41:03 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Public Key Encryption?
Message-Id: <comdog-ya02408000R1703991741030001@news.panix.com>
In article <7cp6th$6gu@newsstand.cit.cornell.edu>, alex@cs.cornell.edu----NOSPAM (Alex Gottschalk) posted:
> I'm writing a CGI that needs to write data encrypted using a public/private
> key scheme such as PGP. Does anyone know of a module that supports this?
> I'll be running this on <wince> MS IIS 4.0, so saying `pgp -e datafile key`
> isn't an option.
just pipe to pgp. no datafile needed.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Wed, 17 Mar 1999 22:31:53 GMT
From: robby.boey@pandora.be (Robby Boey)
Subject: PWS and Perl
Message-Id: <36f02af6.2717676@news.pandora.be>
Hi all!
I have PWS installed on my Win 98 machine (PWS not the one that came
with 98, but the previous version). I installed ActiveState Perl and
all the Perlscripts work just fine, when I run them from the command
promt. I now want to run them from my browser so I copied the script
(filled with the necessary HTML tags) to my scripts-directory. (BTW,
can anyone tell me the difference between the scripts folder and the
cgi-bin folder under the wwwroot??)
If I call the script from within my browser like
http://myserver/scripts/script.pl I get the text that I formatted with
the HTML tags (ie. <H1>,<CENTER>, ...) in the correct way, but the
perlcode is just written down on the screen, so I get something like
this:
print "content type: text/html\n\n"; print <
Een eenvoudige teller
einde open (TELLER,"teller.txt") || die "Kan het bestand niet openen:
$!"; $teller=; $teller++; close(TELLER); open (TELLER,">teller.txt")
|| die "Kan het bestands niet openen: $!"; print TELLER $teller;
close(TELLER); print "U bent de $teller bezoeker!!"; print < einde
and this thing works if run from the command prompt.
What could be wrong? Has it something to do with mappings of the
extension pl to perl? If I take a look in the registry I see no
mapping in
hkey_local_machine/system/CurrentControlSet/Services/W3SVC/Parameters/Script
Map.
Must I put one here manually?
I tried to do this, but then when I call the script from my browser it
takes ages to load the page and I have to click on "stop" eventually,
because nothing happens...
All help is welcome and if someone has a tutorial about configuring
PWS and CGI I would love to see it!!
Best regards,
Robby
------------------------------
Date: Thu, 18 Mar 1999 09:51:22 +1100
From: mostyn <mostynm@gromit.ecr.mu.oz.au>
Subject: Re: recode anyone?
Message-Id: <Pine.SGI.3.95.990318095040.421152A-100000@gromit.ecr.mu.oz.au>
> Why don't you come on over to http://language.perl.com/ppt/ and subscribe to
> the list. That way no one else will be working on it at the same time. :-)
> --Matthew
hmm, sounds like a good idea...
mostyn
--
My fading voice sings of love, /*-----------------------*/
But she cries to the clicking of time. /* Surely you're joking, */
Oh, time. Wait in the fire... /* mostynm@ecr.mu.oz.au */
-- Jeff Buckley, "Grace" /*-----------------------*/
------------------------------
Date: Wed, 17 Mar 1999 14:05:49 -0800
From: "Gala Grant" <gala@sonic.net>
Subject: Regular Expression Help
Message-Id: <7cp8s6$gsh$1@ultra.sonic.net>
I am trying to remove a varying amount of a string from the end of it.
"c:\\web\\content\\tbuedit\\alpha\\tools\\pressroom\\releases\\"
what I need is to be able to remove the end of the string up to the nth set
of \\. I know I could do this by splitting the string into an array, but
that seems like an impractical way to do it. I am hoping to figure out how
to read the string from the end and somehow count the \\ .
Thanks,
Gala Grant
------------------------------
Date: Wed, 17 Mar 1999 16:41:47 -0600
From: Mike <support@counter.w-dt.com>
Subject: Re: rmdir fails Why?
Message-Id: <36F02FAA.10C6733B@counter.w-dt.com>
Tried it doesn't work either
Scratchie wrote:
> Mike <support@counter.w-dt.com> wrote:
> : Whats that mean? can't delete: Invalid argument
> : this is the line its suppose to be on.
> : rmdir "$ads_dir/$INPUT{'accountnumber'}/ads/" or die "can't delete: $!";
>
> You may need to remove the final '/' from your argument.
>
> --Art
>
> --
> --------------------------------------------------------------------------
> National Ska & Reggae Calendar
> http://www.agitators.com/calendar/
> --------------------------------------------------------------------------
------------------------------
Date: Wed, 17 Mar 1999 18:01:29 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: rmdir fails Why?
Message-Id: <comdog-ya02408000R1703991801290001@news.panix.com>
In article <36F02FAA.10C6733B@counter.w-dt.com>, Mike <support@counter.w-dt.com> posted:
> Tried it doesn't work either
>
>
> Scratchie wrote:
>
> > Mike <support@counter.w-dt.com> wrote:
> > : Whats that mean? can't delete: Invalid argument
> > : this is the line its suppose to be on.
> > : rmdir "$ads_dir/$INPUT{'accountnumber'}/ads/" or die "can't delete: $!";
> >
> > You may need to remove the final '/' from your argument.
make sure you know what you are deleting:
$dir = "$ads_dir/$INPUT{'accountnumber'}/ads";
rmdir $dir or die "rmdir: [$dir]: $!";
if that doesn't work, you should make sure that the directory exists
before deleting it.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Wed, 17 Mar 1999 22:46:52 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Server doesnt recognize my .pl files
Message-Id: <slrn7f0can.5j.alastair@calliope.demon.co.uk>
mikej <mikej@1185design.com> wrote:
>This most likely has to do with some small, inconspicous server setting
>somewhere, but I have no clue how to fix it to recognize my perl
>scripts. If anyone knows, please help!
You'll have a better chance of finding someone who knows about web servers in a
group devoted to them. Try ;
comp.infosystems.www.servers.[mac|unix|ms-windows ..]
HTH.
--
Alastair
work : alastair@psoft.co.uk
home : alastair@calliope.demon.co.uk
------------------------------
Date: 18 Mar 1999 00:00:31 +0100
From: Tony Curtis <Tony.Curtis@vcpc.univie.ac.at>
Subject: Re: unlink problem
Message-Id: <83aexbvi0g.fsf@vcpc.univie.ac.at>
Re: unlink problem, Mark <mag@imchat.com> said:
Mark> sub delete { &ReadParse; if ($in{'delete'} eq
Mark> 'yes'){ unlink("$htmldir/$file"); }
Hmmm, looks like a cgi-lib usage to me. Maybe you'd
consider upgrading to the CGI.pm module.
Anyway, the problem is a CGI one - please consult the
"idiot's guide" about CGI related issues.
e.g.
http://www.webpedia.com/prog/perl/idiots-guide/index.html
hth
tony
--
Tony Curtis, Systems Manager, VCPC, | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien. | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds! | private email:
Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>
------------------------------
Date: Wed, 17 Mar 1999 23:17:52 +0100
From: defaultuser@domain.com
Subject: Where to find Perl spel checker
Message-Id: <36F02A10.75364460@domain.com>
I'm a newbie, so anything help to debug. I'm looking for a
spell-checker. Does anyone know where to find it?
------------------------------
Date: Wed, 17 Mar 1999 14:22:33 -0800
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: Which OS am I in
Message-Id: <36F02B29.596F4F2@mail.cor.epa.gov>
Tad McClellan wrote:
> Spike White (spike_YYwhiteYY@YYdellYY.com) wrote:
> : # perldoc -q 'which operating system'
> : Unknown option: q
> : perldoc [options] PageName|ModuleName|ProgramName...
> : perldoc [options] -f BuiltinFunction
> : ....
>
> You have an old version of Perl.
Maybe not *too* terribly ancient, though. The Slowlaris network
I'm using right now gives that error message with Perl
5.004_04 .
Yeah, I know, I know. The network sysadmin is going to let
me install 5.005 on an auxiliary machine and test it out, on
my own time. Assuming I have any of my own time at work anytime
soon...
David
--
David L. Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 5160
**************************************