[7891] in Perl-Users-Digest
Perl-Users Digest, Issue: 1516 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Dec 21 05:07:21 1997
Date: Sun, 21 Dec 97 02:00:37 -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 Sun, 21 Dec 1997 Volume: 8 Number: 1516
Today's topics:
Re: _SUBROUTINE_NAME_ variable? <rootbeer@teleport.com>
a Perl crypt function question <dtlgc@flash.net>
Re: a Perl crypt function question <rootbeer@teleport.com>
Re: Beginner HELP needed :) <rootbeer@teleport.com>
Bidirectional IPC with long strings (Tom "Tom" Harrington)
Convert money amount to text string - convert.pl (Keith Willis)
Re: CORE DUMPS in PERL 5.00404 <rootbeer@teleport.com>
Re: Downloading ALL CPAN Modules? (Jeremy D. Zawodny)
Re: failed exec() (Charles DeRykus)
Re: getting directory size (Jeremy D. Zawodny)
Re: Help needed <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Re: Help on accessing the cgi-bin directory (Jeremy D. Zawodny)
Help please. Perl4/5 compatibility problems. <bruno@prior.ftech.co.uk>
Re: Help please. Perl4/5 compatibility problems. <rootbeer@teleport.com>
How can I Mail attachments with Perl <design@kiwi.net>
Re: HTML File (Michael Ng)
Re: HTML File (Jeremy D. Zawodny)
MDQ: Calling Subroutines <bugaj@bell-labs.com>
Re: MDQ: Calling Subroutines <rootbeer@teleport.com>
newbie .... parse ascii text file and turn it into html <kingr@sabc.co.za>
Re: Password file maintenece (Jeremy D. Zawodny)
Re: PERL > DOS / WIN95 <rootbeer@teleport.com>
Re: Perl editor needed (Michael Ng)
Re: Questions regarding subroutines & perl symbol tabl <rootbeer@teleport.com>
Re: Regular Expression Question - non greedy match (Ilya Zakharevich)
Re: Regular Expression Question - non greedy match (John Moreno)
Re: Script calling another script <rootbeer@teleport.com>
Re: Single key input on NT4.0 with ActiveWare Perl <rootbeer@teleport.com>
Re: Still need HELP (INA) <rootbeer@teleport.com>
strictly confused about CGI.pm <bugaj@bell-labs.com>
Re: strictly confused about CGI.pm <rootbeer@teleport.com>
Re: strictly confused about CGI.pm (William R. Ward)
Verifying a URL (psullivan)
Re: Verifying a URL <ebohlman@netcom.com>
Re: Verifying a URL <rootbeer@teleport.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 20 Dec 1997 22:14:19 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Tim Maher <Tim.Maher@seaslug.org>
Subject: Re: _SUBROUTINE_NAME_ variable?
Message-Id: <Pine.GSO.3.96.971220221326.4324N-100000@user2.teleport.com>
On Sat, 20 Dec 1997, Tim Maher wrote:
> To facilitate the printing of error messages from user-defined subs, I'm
> wondering if there's a built-in variable that knows the name of its
> local subroutine.
No, but try this.
sub foo {
my $name = (caller 0)[3];
print "The name of this sub is $name\n";
print "It can be found in",
" file ", __FILE__,
" line ", __LINE__,
" package ", __PACKAGE__,
"\n";
}
Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: 21 Dec 1997 05:45:06 GMT
From: "Steve Graham" <dtlgc@flash.net>
Subject: a Perl crypt function question
Message-Id: <01bd0dd3$fed3dd00$27381ed1@default>
Hello,
I happen to be stuck wiht a server that does not support the crypt
function.
Besides not encrypting the information, is there another option to perform
this task?
Thanks,
Steve
------------------------------
Date: Sun, 21 Dec 1997 00:04:21 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Steve Graham <dtlgc@flash.net>
Subject: Re: a Perl crypt function question
Message-Id: <Pine.GSO.3.96.971221000341.4324j-100000@user2.teleport.com>
On 21 Dec 1997, Steve Graham wrote:
> I happen to be stuck wiht a server that does not support the crypt
> function.
>
> Besides not encrypting the information, is there another option to
> perform this task?
crypt is one-way. You could use MD5 to do one-way encryption; there's a
module for it on CPAN. Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Sat, 20 Dec 1997 21:55:00 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Terry McC <terrymcc@buffnet.net>
Subject: Re: Beginner HELP needed :)
Message-Id: <Pine.GSO.3.96.971220215434.4324J-100000@user2.teleport.com>
On Sat, 20 Dec 1997, Terry McC wrote:
> I keep on getting the error telling me
> "contained no blank line separating the header and data
> most likely a broken CGI program"
When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN. Hope this helps!
http://www.perl.com/CPAN/
http://www.perl.org/CPAN/
http://www.perl.org/CPAN/doc/FAQs/cgi/idiots-guide.html
http://www.perl.org/CPAN/doc/manual/html/pod/
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Sat, 20 Dec 1997 20:03:14 -0700
From: tph@rmi.net (Tom "Tom" Harrington)
Subject: Bidirectional IPC with long strings
Message-Id: <1d1ksgf.12n7gtl1pyyguyN@[166.93.76.146]>
I'm developing a Perl script that controls a shell-like application
using bidirectional IPC. I had been using Comm.pl's "expect" to
grab the app's output, but I ran into a nasty snag: The app in
question often returns strings well in excess of 256 characters.
And since Comm.pl uses ptys, "expect" chokes and dies when this
happens.
I'm experimenting with using IPC::Open2 to start the process, and
then using sysread to grab the output. It works pretty well
except that it misses the shell prompts from the subprocess.
Since the app performs operations that can take several hours,
sometimes pausing for long periods, I've been using the prompt
as a marker to indicate that it's done. This worked well enough
with expect, until I hit the long output strings.
Can anyone recommend an effective way to do expect-like operations
while handling output strings longer than 256 chars? I notice that
the perlipc man page refers to IPC::Chat as the successor to Comm.pl,
but I haven't been able to track down that module.
[Please cc any replies by email; my newsfeed has been missing
about 60-70% or articles lately.]
My experimental IPC::Open2 script is as follows:
#!/usr/bin/perl
use IPC::Open2;
use FileHandle;
($RDR,$WTR) = FileHandle::pipe;
$pid = open2($RDR,$WTR,"csh");
print "PID: $pid\n";
print $WTR "ls -l\n";
print $WTR "pwd\n";
print $WTR "exit\n";
&readpipe($RDR);
sub readpipe {
# Try to read _all_ output from $RDR
my $RDR = shift;
my $timeout = shift;
$timeout = 1 if($timeout eq "");
vec($rin,fileno($RDR),1) = 1;
print "Reader fileno: ",fileno($RDR),"\n";
($nfound,$timeleft) = select($rin,undef,undef, $timeout);
print "Initial nfound: $nfound\n";
while(($nfound > 0) && sysread($RDR,$a,1000)) {
print $a;
($nfound,$timeleft) = select($rin,undef,undef, $timeout);
}
}
--
Tom Harrington ------- tph@rmii.com ------- http://rainbow.rmii.com/~tph
"It is not I who am crazy... It is I who am MAD!..." -Ren & Stimpy
----> CONSPIRACY ONLINE: http://rainbow.rmii.com/~tph/bunker.html <----
------------------------------
Date: Wed, 17 Dec 1997 14:45:02 GMT
From: keith_willis.junk@non-hp-unitedkingdom-om1.om.hp.com (Keith Willis)
Subject: Convert money amount to text string - convert.pl
Message-Id: <34a2e392.618783373@elf.bri.hp.com>
I recently had a need to convert a money amount to a text string as
in:
input: 123.45
output: One Hundred And Twenty Three Dollars And Forty Five Cents
I have looked through the CPAN list, and was unable to find anything
suitable, but someone in comp.databases.sybase emailed me some BASIC
code to do the job. I hacked it into Perl, and it does work, but
since it is always going to be hacked BASIC in any language, I
wondered whether anyone might have any suggestions for a
different/better/more-perl-like approach.
Code attached - thanks for any constructive criticism.
----------------------------------------------------------------------
The above message reflects my own views, not those of Hewlett Packard.
When emailing me, please note that there is no '.junk' in my address.
begin 644 convert.pl
M(R$O=7-R+V)I;B]P97)L("UW"G5S92!S=')I8W0["@IS=6(@0V]N=F5R=$-U
M<G)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R!V86QU92!B971W965N
M(#$P(&%N9"`Q.3\*"6EF("AS=6)S='(H)$UY5&5N<RP@,"P@,2D@97$@)S$G
M*0H)>PH)"6EF("`@("@D37E496YS(#T](#$P*2$UY5&5N<R`]/2`Q,2D@>R1297-U;'0@/2`G16QE=F5N
M)SM]"@D)96QS:68@*"1->51E;G,@/3T@,3(I('LD4F5S=6QT(#T@)U1W96QV
M92<[?0H)"65L<VEF("@D37E496YS(#T](#$S*2"65L<VEF("@D37E496YS(#T](#$T*2"65L<VEF("@D37E496YS(#T](#$U*2![)%)E<W5L="`]
M("=&:69T965N)SM]"@D)96QS:68@*"1->51E;G,@/3T@,38I('LD4F5S=6QT
M(#T@)U-I>'1E96XG.WT*"0EE;'-I9B`H)$UY5&5N<R`]/2`Q-RD@>R1297-U
M;'0@/2`G4V5V96YT965N)SM]"@D)96QS:68@*"1->51E;G,@/3T@,3@I('LD
M4F5S=6QT(#T@)T5I9VAT965N)SM]"@D)96QS:68@*"1->51E;G,@/3T@,3DI
M('LD4F5S=6QT(#T@)TYI;F5T965N)SM]"@E]"@EE;'-E"@E["@D)(R`N+B!O
M=&AE<G=I<V4@:70G<R!B971W965N(#(P(&%N9"`Y.2X*"0DD1&EG:70@/2!S
M=6)S='(H)$UY5&5N<RP@,"P@,2D["@D):68@("`@*"1$:6=I="!E<2`G,B<I
M('LD4F5S=6QT(#T@)U1W96YT>2`G.WT*"0EE;'-I9B`H)$1I9VET(&5Q("<S
M)RD@>R1297-U;'0@/2`G5&AI<G1Y("<[?0H)"65L<VEF("@D1&EG:70@97$@
M)S0G*2T>2`G.WT*"0EE;'-I9B`H)$1I9VET(&5Q
M("<U)RD@>R1297-U;'0@/2`G1FEF='D@)SM]"@D)96QS:68@*"1$:6=I="!E
M<2`G-B<I('LD4F5S=6QT(#T@)U-I>'1Y("<[?0H)"65L<VEF("@D1&EG:70@
M97$@)S<G*2"65L<VEF("@D1&EG
M:70@97$@)S@G*2SM]"@D)96QS:68@*"1$
M:6=I="!E<2`G.2<I('LD4F5S=6QT(#T@)TYI;F5T>2`G.WT*"@D)(R!#;VYV
M97)T(&]N97,@<&QA8V4@9&EG:70N"@D))%)E<W5L="`]("1297-U;'0@+B!#
M;VYV97)T1&EG:70H<W5B<W1R*"1->51E;G,L+3$I*3L*"7T*"@ER971U<FX@
M*"1297-U;'0I.PI]"@IS=6(@0V]N=F5R=$1I9VET*"0I"GL*"6UY("1->41I
M9VET(#T@<VAI9G0["@H):68@("`@*"1->41I9VET(&5Q("<Q)RD@>W)E='5R
M;B`G3VYE)SM]"@EE;'-I9B`H)$UY1&EG:70@97$@)S(G*2![<F5T=7)N("=4
M=V\G.WT*"65L<VEF("@D37E$:6=I="!E<2`G,R<I('MR971U<FX@)U1H<F5E
M)SM]"@EE;'-I9B`H)$UY1&EG:70@97$@)S0G*2![<F5T=7)N("=&;W5R)SM]
M"@EE;'-I9B`H)$UY1&EG:70@97$@)S4G*2![<F5T=7)N("=&:79E)SM]"@EE
M;'-I9B`H)$UY1&EG:70@97$@)S8G*2![<F5T=7)N("=3:7@G.WT*"65L<VEF
M("@D37E$:6=I="!E<2`G-R<I('MR971U<FX@)U-E=F5N)SM]"@EE;'-I9B`H
M)$UY1&EG:70@97$@)S@G*2![<F5T=7)N("=%:6=H="<[?0H)96QS:68@*"1-
M>41I9VET(&5Q("<Y)RD@>W)E='5R;B`G3FEN92<[?0I]"@IW:&EL92`H/#XI
M"GL*"65X:70@:68@*"]Q=6ET+RD["@H)<')I;G1F("(E<UQN(BP@0V]N=F5R
:=$-U<G)E;F-Y5&]%;F=L:7-H*"1?*3L*?0II
`
end
------------------------------
Date: Sat, 20 Dec 1997 21:27:31 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Matthew Feinberg <matt@monmouth.com>
Subject: Re: CORE DUMPS in PERL 5.00404
Message-Id: <Pine.GSO.3.96.971220212544.4324G-100000@user2.teleport.com>
On Sat, 20 Dec 1997, Matthew Feinberg wrote:
> Subject: CORE DUMPS in PERL 5.00404
You don't need to shout!
> Has enyone else seen Core Dumps on new builds of Perl 5.00404 under BSDI
> 2.1 and 3.0?
Not I. Can you reproduce them? Can you use gdb to track down the problem?
Can you submit a patch? :-) Well, let's start small, and work our way up:
Can you make a small (say, ten line) program which reliably dumps core?
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Sun, 21 Dec 1997 05:23:25 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: Downloading ALL CPAN Modules?
Message-Id: <349da7a3.563240136@woody.wcnet.org>
[original author automagically cc'd via e-mail]
On 19 Dec 1997 16:24:49 -0800, rsr@best.com (Roy S. Rapoport) wrote:
>So two questions:
>A) Why _shouldn't_ I download+install all the modules?
Because you don't *need* all of them.
>B) Has anyone come up with an automated way to get all the modules? It
> doesn't _look_ like the CPAN module deals with 'install *' ...
Yeah, I use the good 'ol mirror program to mirron a CPAN mirror when I
need to get all of CPAN.
Jeremy
--
Jeremy D. Zawodny jzawodn@wcnet.org
Web Server Administrator www@wcnet.org
Wood County Free Net (Ohio) http://www.wcnet.org/
------------------------------
Date: Sun, 21 Dec 1997 03:19:07 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: failed exec()
Message-Id: <ELIrvw.CH3@bcstec.ca.boeing.com>
In article <19971220151133297271@user-37kb6dq.dialup.mindspring.com>,
Justin Vallon <vallon@mindspring.com> wrote:
> M.J.T. Guy <mjtg@cus.cam.ac.uk> wrote:
>
>>
>> David Minsterman <daminste@mailbox.syr.edu> wrote:
>> >What I am using is this: exec "java $programname"
>>
>> That is dangerous, if the $programname is somehow user supplied.
>> Consider what happens if the $programname were '; rm -rf /'
>> (or corresponding for non-unix systems).Use the multi-argument
>> form of exec instead. It's also more efficient.
>>
>> exec 'java', $programname or die "exec failed: $!"
>>
>>
>
> If exec "string" calls exec, that is not an issue, since you would
> require the shell to run multiple commands. Remember, exec loads the
> program 'java', and gives it arguments (":", "rm", "-rf", "/"), which
> java would probably barf on.
>
> I would worry about system("blah blah $user_arg").
>
> The list-exec is nicer anyway to be explicit about arguments (spaces,
> etc).
Um, what if this is passed this to the exec:
@{[system q^rm -rf /^]}
--
Charles DeRykus
------------------------------
Date: Sun, 21 Dec 1997 05:24:30 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: getting directory size
Message-Id: <349ea7f8.563325679@woody.wcnet.org>
[original author automagically cc'd via e-mail]
On Fri, 19 Dec 1997 19:02:31 -0600, Brian <signal@shreve.net> wrote:
>I recently wrote a perl program to tell me which users of ours have web
>pages in there directories, and if so, how much space it was taking up.
>Now I know my code is very sloppy, please forgive. What I am trying to
>accomplish is to get it to go faster.......
>
>I am looking for a native perl function or library that will have
>something similar to the "du" command in it so I can get directory
>sizes. Also feel free to critisize my code and tell me any other places
>I am doing something wrong and could make it better/faster.
The combination of stat() and File::Find ought to do what you need.
Jeremy
--
Jeremy D. Zawodny jzawodn@wcnet.org
Web Server Administrator www@wcnet.org
Wood County Free Net (Ohio) http://www.wcnet.org/
------------------------------
Date: Sun, 21 Dec 1997 00:31:20 -0800
From: "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Subject: Re: Help needed
Message-Id: <67ik3l$59g@mtinsc04.worldnet.att.net>
Hey, what can I say? When I'm wrong, I'm wrong. Hopefully I was right about
the rest of it. :D
--- Creede Lambard
Minister of Irregular Expressions
Programming Republic of Perl
Chipmunk wrote in message <349C1512.CB13C429@coos.dartmouth.edu>...
>Creede Lambard wrote:
>>
[ snip ]
>> Say you want to find what's between "foo" and "bar" in a string $baz. You
>> could do something like this:
>>
>> $_ = $baz;
>> $match = /foo([.\n]*?)bar/ && $1;
>
>You could, but you definitely would not want to!
>
>'.' is not a metacharacter inside a character class. The above
>regexp would match only if the string between foo and bar
>consists entirely of periods and newlines!
>
>The correct way to do what you suggest is:
>
>$match = /foo(.*?)bar/s && $1;
>
>The /s modifier allows '.' to match newlines.
>
>Chipmunk
------------------------------
Date: Sun, 21 Dec 1997 05:27:23 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: Help on accessing the cgi-bin directory
Message-Id: <34a0a890.563477057@woody.wcnet.org>
[original author automagically cc'd via e-mail]
On Fri, 19 Dec 1997 23:22:45 -0500, Jason Schutz
<jds35239@pegasus.cc.ucf.edu> wrote:
> I don't know what the problem is, maybe just a lack of privlidges,
>but I have the password for an account on an NT server and the cgi-bin I
>need to access runs parallel to my directory and I can't access it. Is
>there any way other than saying cd ../cgi-bin (which I tried) to access
>this directory. Plus I've tried using put and get put that doesn't work
>either. Please help.
Check in a web server newsgroup or ask your system administrator for
help.
Your question has nothing to do with Perl (that you've told us, at
least), so it does not belong in comp.lang.perl.misc.
Jeremy
--
Jeremy D. Zawodny jzawodn@wcnet.org
Web Server Administrator www@wcnet.org
Wood County Free Net (Ohio) http://www.wcnet.org/
------------------------------
Date: 21 Dec 1997 03:15:48 GMT
From: "Bruno Prior" <bruno@prior.ftech.co.uk>
Subject: Help please. Perl4/5 compatibility problems.
Message-Id: <01bd0dbe$e2395f40$0201a8c0@prior.ftech.co.uk>
I don't seem to be able to read or write dbm files in Perl5
that I created with Perl4. I have tried both dbmopen and
tie, but although they work fine with files created under
Perl5, I can't get at the old ones. I have tried using all
the different DBM modules with tie, but none of them work.
The old files are .dir/.pag pairs, which is what SDBM_File
creates, so I guess that's the closest, but it doesn't work
any better than the others. No error message is returned.
I'm using RedHat 4.1 Linux (kernel version 2.0.27), on a
dual Pentium Pro. I've got libgdbm in /usr/lib and the perl
DBM modules in /usr/lib/perl5, so I can't think that
anything's missing.
I'm pretty new to Perl5 (I've been putting off updating
precisely because of this problem). I'm probably missing
out something obvious. Has anyone got any ideas what it
might be.
Cheers,
Bruno Prior bruno@prior.ftech.co.uk
------------------------------
Date: Sat, 20 Dec 1997 22:27:54 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Bruno Prior <bruno@prior.ftech.co.uk>
Subject: Re: Help please. Perl4/5 compatibility problems.
Message-Id: <Pine.GSO.3.96.971220222059.4324Q-100000@user2.teleport.com>
On 21 Dec 1997, Bruno Prior wrote:
> I don't seem to be able to read or write dbm files in Perl5 that I
> created with Perl4. I have tried both dbmopen and tie, but although they
> work fine with files created under Perl5, I can't get at the old ones. I
> have tried using all the different DBM modules with tie, but none of
> them work.
Try again; there's one that will work, possibly one that you haven't yet
tried.
If you absolutely positively can't install a module that's compatible with
the file format, the only remaining option is to use the program that can
read the files (Perl4) to convert them. Here's one way:
Make a simple Perl4 program which reads the data, then outputs key-value
pairs, each key and value terminated by a null character. (Of course, if
your keys or values may contain nulls, you'll have to choose a different
output format.) Let's call that program read_file.
Now make an equally-simple Perl5 program which reads its input separated
by nulls, and writes the new database file. Pipe from one program to the
other, and you're set!
Be sure to save a backup of your valuable data, though... Hope this
helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Sat, 20 Dec 1997 18:02:00 -0800
From: Craig <design@kiwi.net>
Subject: How can I Mail attachments with Perl
Message-Id: <349C7898.661E52B0@kiwi.net>
Does anyone know how to send an attachment with Perl?
I know how to "upload" with the ENCTYPE=\"multipart/form-data\"
attibute.
But how can a Perl script download information as an attachment?
------------------------------
Date: 21 Dec 1997 05:04:21 GMT
From: syng@garlic.engr.ucdavis.edu (Michael Ng)
Subject: Re: HTML File
Message-Id: <67i80l$mmh$3@mark.ucdavis.edu>
I also have the same problem in doing my download survey form (those html
forms require user fill out before they download something)
My workaround is to translate newlines into plain space before writing
to the file. I haven't tried it myself, however.
use tr should do.
Hope it help.
Ho Seng Yip
(cybercom@pacific.net.sg) wrote: ::> Hi,
::> I will like to save the input of a form data into a html file for display
::> or collection of all the inputs. What I did was to write the data into a
::> text file like the one below,
::> Stephen|stephen.ho@hotmail.com|Welcome
::> Stephen|stephen.ho@hotmail.com|Welcome again
::> After which the file will be read and a html version of the file will be
::> produced. The problem I had was that if there were empty lines in the
::> input, for example,
::> Welcome once again
::> Regards,
::> Stephen
::> The whole text file will be messed up and the output unsightly. Once that
::> occurs, the text file will be something like,
::> Stephen|stephen.ho@hotmail.com|Welcome
::> Stephen|stephen.ho@hotmail.com|Welcome again
::> Stephen|stephen.ho@hotmail.com|Welcome once again
::> Regards,
::> Stephen
::> As you can see there were to extra potruding lines comming out in the text
::> file. Can someone kindly advise me of the best solution in this case ?
::> Hope to hear some replies soon ! ;-)
::> Regards,
::> Seng Yip
--
Michael (syng@engr.ucdavis.edu)
+--------------------------------------------------------------+
| http://www.engr.ucdavis.edu/~syng/ |
| <PGP public key: http://www.engr.ucdavis.edu/~syng/mike.pgp> |
+--------------------------------------------------------------+
------------------------------
Date: Sun, 21 Dec 1997 05:21:19 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: HTML File
Message-Id: <349ca6a2.562983797@woody.wcnet.org>
[original author automagically cc'd via e-mail]
On 18 Dec 1997 02:30:02 GMT, "Ho Seng Yip" <cybercom@pacific.net.sg>
wrote:
>The whole text file will be messed up and the output unsightly. Once that
>occurs, the text file will be something like,
>
> Stephen|stephen.ho@hotmail.com|Welcome
> Stephen|stephen.ho@hotmail.com|Welcome again
> Stephen|stephen.ho@hotmail.com|Welcome once again
>
> Regards,
> Stephen
>
>As you can see there were to extra potruding lines comming out in the text
>file. Can someone kindly advise me of the best solution in this case ?
>
>Hope to hear some replies soon ! ;-)
Hm.
Maybe this is obvious to me, but why not exclude the blank lines if
that's truly what you want?
Just setup a regex to match blank lines and skip them. Something like
/^\s*$/ would work.
Jeremy
--
Jeremy D. Zawodny jzawodn@wcnet.org
Web Server Administrator www@wcnet.org
Wood County Free Net (Ohio) http://www.wcnet.org/
------------------------------
Date: Sat, 20 Dec 1997 23:03:20 -0500
From: Stephan Vladimir Bugaj <bugaj@bell-labs.com>
Subject: MDQ: Calling Subroutines
Message-Id: <349C9508.2781@bell-labs.com>
Why is calling a subroutine as &sub(); or &sub($var); considered
bad?
What is the current @_ if ⊂ is called outside of another
subroutine, in what a C person might want to call main()? My
guess is that it's the empty list.
I've been told by a friend that calling a function without
parens will gain me compile-time type checking vs. run-time
type checking with parens. As unreadable as that sounds to a
not-quite-reformed C'er, I'm considering going back through my
code at some point and rip out all the parens to make sure
it'll bail at compile time if I mis-call a non-variadic function.
How do I get this benefit for methods? I tried defining some
methods with protos in one of my class modules and then doing:
require myClass;
$foo = new myClass data_member=>$value;
$foo->function arg1,arg2;
and $foo->function arg1, arg2; caused a syntax error.
LL+P,
Stephan
--
"Do computers think?"
---------------------------------------------------------------
Stephan Vladimir Bugaj bugaj@bell-labs.com
Member of Technical Staff (908) 949-3875
Multimedia Communication Research Dept. Rm. 4F-601, Holmdel
Bell Labs of Lucent Technologies www.multimedia.bell-labs.com
PGPkey from http://www.pgp.net/wwwkeys.html or other keyservers
Non-Lucent website: http://www.cthulhu-dynamics.com/stephan
---------------------------------------------------------------
STANDARD DISCLAIMER:My opinions are NOT those of LUCENT
---------------------------------------------------------------
"Do submarines swim?" - E.W. Dijkstra
------------------------------
Date: Sat, 20 Dec 1997 22:34:08 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Stephan Vladimir Bugaj <bugaj@bell-labs.com>
Subject: Re: MDQ: Calling Subroutines
Message-Id: <Pine.GSO.3.96.971220222817.4324R-100000@user2.teleport.com>
On Sat, 20 Dec 1997, Stephan Vladimir Bugaj wrote:
> Why is calling a subroutine as &sub(); or &sub($var); considered bad?
Who considers it bad? :-)
> What is the current @_ if ⊂ is called outside of another
> subroutine, in what a C person might want to call main()? My
> guess is that it's the empty list.
@_ is the currently executing sub's parameter list. That may be the empty
list, of course.
> I've been told by a friend that calling a function without
> parens will gain me compile-time type checking vs. run-time
> type checking with parens.
Probably thinking of prototypes, described in the perlsub manpage. But
your friend's description seems to differ from what's in the docs. :-)
Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Sun, 21 Dec 1997 11:11:45 +0200
From: "Richard King" <kingr@sabc.co.za>
Subject: newbie .... parse ascii text file and turn it into html?
Message-Id: <67imji$nob$1@hermes.is.co.za>
I need to parse a text file and turn it into html - are there any simple
scripts around that would do this?
(I have News Editors, saving stories in ascii to our server, where we use a
SSI to place the text into a webpage -
they'd like to see a fancier font....)
I'd be very grateful for any assistance!
Thanks,
Richard King
Channel Africa
http://www.sabc.co.za/units/chanafr/currenta.shtml
... the page in question.
------------------------------
Date: Sun, 21 Dec 1997 05:25:50 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: Password file maintenece
Message-Id: <349fa81a.563359728@woody.wcnet.org>
[original author automagically cc'd via e-mail]
On Fri, 19 Dec 1997 19:13:31 -0600, Brian <signal@shreve.net> wrote:
>Do any perl functions/librarys exist for maintaining the password files
>on unix systems? Something like:
There is one under development at:
http://www.wcnet.org/~jzawodn/perl/AcctInfo/
I hope to have the password/shadow file manipulation code finished
over the Christmas holiday.
I wrote it all once before, two years ago, for a job I was doing. I'm
trying to modularize it and make it generally more friendly.
Jeremy
--
Jeremy D. Zawodny jzawodn@wcnet.org
Web Server Administrator www@wcnet.org
Wood County Free Net (Ohio) http://www.wcnet.org/
------------------------------
Date: Sat, 20 Dec 1997 22:17:21 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "Ing.Heinz Riemer" <office_vienna@yahoo.com>
Subject: Re: PERL > DOS / WIN95
Message-Id: <Pine.GSO.3.96.971220221529.4324O-100000@user2.teleport.com>
On Sun, 21 Dec 1997, Ing.Heinz Riemer wrote:
> I want to write PERL 4.
You're late. Larry Wall already wrote it, and then made it obsolete. :-)
> I have a WINDOWS 95 and want to test my CGI-pgm
> when I write.
You don't need (and shouldn't use) Perl4 for that. Use a recent version of
Perl with the CGI module (or a similar one) to test your scripts from the
command line.
> How can I do? Is there a PERL for DOS or WIN95 for easy
> install? Who can help?
If you have more questions about Perl which aren't answered in the docs
and FAQs, please post them here. Thanks!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: 21 Dec 1997 04:59:31 GMT
From: syng@garlic.engr.ucdavis.edu (Michael Ng)
Subject: Re: Perl editor needed
Message-Id: <67i7nj$mmh$2@mark.ucdavis.edu>
I guess it only blinks the openning brace/paren when you close one. It
also shows a short message on the status line if the openning brace/paren
is not inside the current window
I recall in XWindow, however, you can select to highlight the whole block
when you close it. I am not sure if GNU Emacs can do this or not.
Pls correct me if I am wrong, I haven't used XEmacs for quite a while and
I am not a Emacs expert either.
Jim Michael (genepool@netcom.com) wrote:
::> Would those familiar with Emacs, etc. please describe the color syntax
::> highlighing and brace/bracket/paren matching functions? Does the paren
::> matching work by generating a close paren when an open paren is entered,
::> or provide a different text color for each paren nesting level or ??? TIA.
::> Cheers,
::> Jim
--
Michael (syng@engr.ucdavis.edu)
+--------------------------------------------------------------+
| http://www.engr.ucdavis.edu/~syng/ |
| <PGP public key: http://www.engr.ucdavis.edu/~syng/mike.pgp> |
+--------------------------------------------------------------+
------------------------------
Date: Sat, 20 Dec 1997 21:52:42 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Joe Guderjohn <guderjoj@erols.com>
Subject: Re: Questions regarding subroutines & perl symbol tables
Message-Id: <Pine.GSO.3.96.971220213043.4324H-100000@user2.teleport.com>
On Sat, 20 Dec 1997, Joe Guderjohn wrote:
> Is it possible to access the %sub array, or an equivalent structure, if
> the -d switch is not used?
That would be %DB::sub, would it not? I don't think so. But you could
define your own debugging module that would give you what you want,
perhaps. (Or perhaps not.)
> Also, is there a way to learn the name of the currently executing
> subroutine, as you can get the name of the calling routine from "caller".
Do you mean, get the name of the sub from within the sub itself? Not hard
to do:
sub foo {
my $name = (caller 0)[3];
print "The name of this sub is $name\n";
print "It can be found in",
" file ", __FILE__,
" line ", __LINE__,
" package ", __PACKAGE__,
"\n";
}
Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: 21 Dec 1997 01:52:12 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Regular Expression Question - non greedy match
Message-Id: <67hsoc$q1i$1@agate.berkeley.edu>
Keywords: just another new york perl hacker
In article <eli$9712202003@qz.little-neck.ny.us>,
Eli the Bearded <#@qz.to> wrote:
> > > > $count = s/(#! rnews )(\d+\n)(.+?)/$1.(length $3).("\n").$3/gse;
> > > > Which gives 1 char for the (length $3), I would have thought that it
> > > > would go until it hit the next #! rnews.
> > > Why should it? You said .+? which means at least one any character and
> > > the least possible count. Which gives us nice 1.
> > I understand what it was doing, I'm just not sure why the ? wasn't more
> > greedy - I would have thought that when using the /g that a ? at the end
> It is my opinion that non-greedy repetition is very subtle and tends to
> expose a large number of programmer bugs. I almost always recommend doing
> without it.
>
> I'd do something like this myself:
>
> $r='#! rnews ';
>
> $count = s/$r\d+\n((?:(?!$r)#|[^#]+)+)/$r.(length $1)."\n$1"/gse;
How is it less error-prone than
/$r(\d+\n)(.+?)(?=$r|$)/
?
Ilya
------------------------------
Date: Sat, 20 Dec 1997 23:16:56 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: Regular Expression Question - non greedy match
Message-Id: <1d1kyco.11mmwhh17ifl67N@roxboro-173.interpath.net>
In comp.lang.perl.misc Eli the Bearded <#@qz.to> wrote:
> John Moreno <phenix@interpath.com> wrote:
> > Honza Pazdziora <adelton@fi.muni.cz> wrote:
> > > phenix@interpath.com (John Moreno) writes:
> > > > $count = s/(#! rnews )(\d+\n)(.+?)/$1.(length $3).("\n").$3/gse;
> > > > Which gives 1 char for the (length $3), I would have thought that it
> > > > would go until it hit the next #! rnews.
> > > Why should it? You said .+? which means at least one any character and
> > > the least possible count. Which gives us nice 1.
> > I understand what it was doing, I'm just not sure why the ? wasn't more
> > greedy - I would have thought that when using the /g that a ? at the end
>
> The DWIM operator has not yet become part of the standard perl regular
> expression functionality. In the meantime, we have normal greedy repetion
> operators such as + and *, and we have non-greedy versions, such as +?
> and *?. The greedy ones always try to grab as much as possible, the non-
> greedy ones always try to grab as little as possible.
Well, I didn't expect it use the DWIM operator, I guess what I didn't
understand clearly was that the ? is evaluated in relationship to the
whole expression not just it's little part of it. Which means that if
it did what I thought it would do (use the ? with the next value being
considered the beginning of the regex) it would have problems with
infinite recursions.
Instead it has the more generally useful lookahead functions - they just
didn't occur to me until after I'd already completed the project.
> It is my opinion that non-greedy repetition is very subtle and tends to
> expose a large number of programmer bugs. I almost always recommend doing
> without it.
Well it isn't normally my first thought either - not that I have enough
experience for that to mean anything.
--
John Moreno
------------------------------
Date: Sat, 20 Dec 1997 21:59:52 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Thomas Paine <paineta@edp.net>
Subject: Re: Script calling another script
Message-Id: <Pine.GSO.3.96.971220215632.4324K-100000@user2.teleport.com>
On 18 Dec 1997, Thomas Paine wrote:
> I have a web page that has a simple form on it with four options. It
> works fine execpt I need to be able to make the first script call a
> second one. Can't I use the system() and /or exec() functions for this?
You should know better than we whether you can or can't - could you, when
you tried? :-)
Good luck!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Sat, 20 Dec 1997 21:54:10 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: John Gordon White <johnw@usmh.usmd.edu>
Subject: Re: Single key input on NT4.0 with ActiveWare Perl
Message-Id: <Pine.GSO.3.96.971220215350.4324I-100000@user2.teleport.com>
On Fri, 19 Dec 1997, John Gordon White wrote:
> How can I do single key input from the keyboard?
Does the entry in the FAQ give you any help?
http://www.perl.com/CPAN/doc/manual/html/pod/perlfaq5/
How_can_I_read_a_single_characte.html
Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Sat, 20 Dec 1997 22:11:29 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Terry McC <terrymcc@buffnet.net>
Subject: Re: Still need HELP (INA)
Message-Id: <Pine.GSO.3.96.971220220442.4324L-100000@user2.teleport.com>
On Sat, 20 Dec 1997, Terry McC wrote:
> Subject: Still need HELP (INA)
Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
> Need help with a simple perl program.
Perhaps you could be more specific. If there's something about Perl which
you can't find in the docs and FAQs, could you tell us what it is?
> Someone named Ina replied to me but I can NOT get on your site:(
> There is a problem with my email address?? Ina Please send me email so
> I can reply back to you (not the auto responder :-)
There are some handy documents available through the URLs below. One is
about finding someone's email address, so you could write to her directly,
but the others are also worth checking out.
ftp://rtfm.mit.edu:/pub/usenet/news.newusers.questions/
ftp://rtfm.mit.edu:/pub/usenet/news.announce.newusers/
Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Sat, 20 Dec 1997 23:55:03 -0500
From: Stephan Vladimir Bugaj <bugaj@bell-labs.com>
Subject: strictly confused about CGI.pm
Message-Id: <349CA127.794B@bell-labs.com>
#!/usr/local/bin/perl -w
...code...
print...some query stuff...
$query->popup_menu(-name=>'view_select',
-values=>['netscape'],
-default=>'netscape',
-labels=>{'netscape' => 'Netscape'}
)...more...;
When I don't use strict, this is just fine... but if I use
strict I get:
Ambiguous use of values => resolved to "values" => at
modules/loginPage.pm line 50.
LL+P,
Stephan
--
"Do computers think?"
---------------------------------------------------------------
Stephan Vladimir Bugaj bugaj@bell-labs.com
Member of Technical Staff (908) 949-3875
Multimedia Communication Research Dept. Rm. 4F-601, Holmdel
Bell Labs of Lucent Technologies www.multimedia.bell-labs.com
PGPkey from http://www.pgp.net/wwwkeys.html or other keyservers
Non-Lucent website: http://www.cthulhu-dynamics.com/stephan
---------------------------------------------------------------
STANDARD DISCLAIMER:My opinions are NOT those of LUCENT
---------------------------------------------------------------
"Do submarines swim?" - E.W. Dijkstra
------------------------------
Date: Sat, 20 Dec 1997 22:40:22 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Stephan Vladimir Bugaj <bugaj@bell-labs.com>
Subject: Re: strictly confused about CGI.pm
Message-Id: <Pine.GSO.3.96.971220223613.4324S-100000@user2.teleport.com>
On Sat, 20 Dec 1997, Stephan Vladimir Bugaj wrote:
> $query->popup_menu(-name=>'view_select',
> -values=>['netscape'],
> -default=>'netscape',
> -labels=>{'netscape' => 'Netscape'}
> )...more...;
>
> When I don't use strict, this is just fine... but if I use
> strict I get:
>
> Ambiguous use of values => resolved to "values" => at
> modules/loginPage.pm line 50.
Yes, because values() is a builtin. (Or, it could have been a sub you
defined.) If you wish to avoid that warning, you can quote the string,
writing either -'values' or '-values', in much the same way that you
quoted the word 'netscape' in the -labels category. Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: 21 Dec 1997 00:54:21 -0800
From: hermit@cats.ucsc.edu (William R. Ward)
Subject: Re: strictly confused about CGI.pm
Message-Id: <waau3c35b5u.fsf@ese.UCSC.EDU>
Tom Phoenix <rootbeer@teleport.com> writes:
> On Sat, 20 Dec 1997, Stephan Vladimir Bugaj wrote:
>
> > $query->popup_menu(-name=>'view_select',
> > -values=>['netscape'],
> > -default=>'netscape',
> > -labels=>{'netscape' => 'Netscape'}
> > )...more...;
> >
> > When I don't use strict, this is just fine... but if I use
> > strict I get:
> >
> > Ambiguous use of values => resolved to "values" => at
> > modules/loginPage.pm line 50.
>
> Yes, because values() is a builtin. (Or, it could have been a sub you
> defined.) If you wish to avoid that warning, you can quote the string,
> writing either -'values' or '-values', in much the same way that you
> quoted the word 'netscape' in the -labels category. Hope this helps!
Another way to avoid this problem without ugly quotes all over the
place is to use all-caps for the attributes; CGI.pm is
case-insensitive there (though not in the function names!).
--Bill.
--
William R Ward Bay View Consulting http://www.bayview.com/~hermit/
hermit@bayview.com 1803 Mission St. #339 voicemail +1 408/479-4072
hermit@cats.ucsc.edu Santa Cruz CA 95060 USA pager +1 408/458-8862
PGP Key 0x2BD331E5; Public key at http://www.bayview.com/~hermit/pubkey.txt
------------------------------
Date: Sun, 21 Dec 97 05:43:58 GMT
From: psullivan@stlnet.com (psullivan)
Subject: Verifying a URL
Message-Id: <67ian1$srm$1@news.stlnet.com>
I am writing a quick cgi to add links supplied by a random user to a html
page. Before i add the link to the page, I would like to check the validity of
the URL to make sure that it exists. How would I do this in perl? Would i use
a socket? If so, how? Thanks.
Patrick Sullivan
------------------------------
Date: Sun, 21 Dec 1997 07:25:45 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Verifying a URL
Message-Id: <ebohlmanELJ3Ax.1Gz@netcom.com>
psullivan <psullivan@stlnet.com> wrote:
: I am writing a quick cgi to add links supplied by a random user to a html
: page. Before i add the link to the page, I would like to check the validity of
: the URL to make sure that it exists. How would I do this in perl? Would i use
: a socket? If so, how? Thanks.
You'd get the LWP module from CPAN, read the extremely comprehensive
documentation included with it, and then most likely you'd use
LWP::Simple::head() to check the URL. You *could* do it by writing your
own socket code, but that would be a rather foolish choice, since
somebody else has already done all the work and, even more important,
debugged it.
------------------------------
Date: Sun, 21 Dec 1997 00:05:47 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: psullivan <psullivan@stlnet.com>
Subject: Re: Verifying a URL
Message-Id: <Pine.GSO.3.96.971221000459.4324k-100000@user2.teleport.com>
On Sun, 21 Dec 1997, psullivan wrote:
> I would like to check the validity of the URL to make sure that it
> exists. How would I do this in perl?
Almost certainly, you'll want to use the LWP module, and a HEAD request.
Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.
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 1516
**************************************