[11205] in Perl-Users-Digest
Perl-Users Digest, Issue: 4805 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Feb 2 10:07:14 1999
Date: Tue, 2 Feb 99 07:00:27 -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 Tue, 2 Feb 1999 Volume: 8 Number: 4805
Today's topics:
Re: Anyone familar with CGI.pm internals? <fty@utk.edu>
Re: Comments in Perl code <tchrist@mox.perl.com>
Re: debug this script please <debot@xs4all.nl>
Re: debug this script please <debot@xs4all.nl>
Getting the wildcard value <holt@watson.ibm.com>
locking/linking files - HELP <kiml@worldnetla.net>
ndbm store returned -1 error <jimdavidson@lucent.com>
New posters to comp.lang.perl.misc <gbacon@cs.uah.edu>
Re: Perl Criticism topmind@technologist.com
Perl in ASP code <simon.gillespie@virgin.com>
Re: Perl syntax ( URGENT ) <debot@xs4all.nl>
Re: Question about Regular Expression <ebohlman@netcom.com>
read an html from a url <guillaume@nospam.com>
Re: read an html from a url <ebohlman@netcom.com>
Regex for e-mail addresses? <revjack@radix.net>
Re: Request for negative value list indexes droby@copyright.com
reused functions. <ishay@cpm.elex.co.il>
Re: reused functions. <ebohlman@netcom.com>
Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
submit a form and Perl question <acetone@bigfoot.com>
Re: submit a form and Perl question <ebohlman@netcom.com>
Re: Using Net (I R A Aggie)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 02 Feb 1999 09:31:55 -0500
From: Jay Flaherty <fty@utk.edu>
To: Bill Moseley <moseley@best.com>
Subject: Re: Anyone familar with CGI.pm internals?
Message-Id: <36B70C5B.F78D967A@utk.edu>
Bill Moseley wrote:
>
> I've got about a 1500 line script that seems to be working fine. One odd
> thing is that when run from the command line I get
>
> (offline mode: enter name=value pairs on standard input)
>
> which is normal, but then I press ^Z or ^D (depending on where I'm
> running it) and then I get
>
> (offline mode: enter name=value pairs on standard input)
>
> again, a second time.
>
> It's only happening with this one script, and on both my PC and on a unix
> machine. No error messages are printing, and no messages are in the
> server logs.
>
> Maybe it's no big deal, but I wonder what I'm doing (perhaps wrong) in my
> script to make CGI.pm print two of those messages.
>
> Any ideas?
Are you using ReadParse() and $q = new CGI; t:whis creates two objects.
If you are and still want to use OO method calls do the following:
use CGI qw(:cgi-lib);
ReadParse();
$q = $in{CGI};
Jay
------------------------------
Date: 2 Feb 1999 07:29:12 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Comments in Perl code
Message-Id: <36b70bb8@csnews>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
bart.lateur@skynet.be (Bart Lateur) writes:
:Tom Christiansen wrote:
:>slower. No matter how many comments you put in Perl code, it will never
:>run any slower. Perhaps I might interest you in a compiler class?
:
:But the compiling itself will be slowed down, most due to reading of
:the larger file.
I'm not talking about compiling. I'm talking about executing. You're
right that the compilation of both the Perl and the C program would be
"slowed down" by the presence of comments. But this is irrelevant, and
it's very dangerous to dwell upon the matter. In fact, I would probably
fire any programmer whom I caught skimping on documentation for such
idiotic reasons. He could obviously use a lesson about what's really
important in a program, or even how a program is compiled and executed.
--tom
--
You know, by the time you get done with all this, the "Swiss Army
Chainsaw" is going to be more like a Swiss Army Tactical Nuke.... :-)
--Brandon Allbery on perl in <1991Feb21.002412.20045@NCoast.ORG>
------------------------------
Date: Tue, 02 Feb 1999 15:12:52 +0100
From: Frank de Bot <debot@xs4all.nl>
Subject: Re: debug this script please
Message-Id: <36B707E3.52701C20@xs4all.nl>
This would do the same trick:
#!/usr/bin/perl -w
use strict;
srand;
print "content-type: text/html\n\n";
print '<img src="',int(rand(4)),'.gif">\n';
In your scripts you had forgotten this: { . You've wrote: if (x=x) do
this;}
"myname@mydomain.com" wrote:
> Can anyone tell me what is wrong with this script ?
> I really don't get it, I always get an internal server error.
> I chmod te files read/write/execute
>
> Please help,
>
> Peter
>
> netket@dma.be
>
> #!/usr/bin/perl -w
> use strict;
> srand;
> my $whichImg = rand(4);
> my $img;
> if ($whichImg < 1)
>
> $img = '1.gif';
> }
> elsif ($whichImg < 2)
>
> $img = '2.gif';
> }
> elsif ($whichImg < 4)
>
> $img = '3.gif';
> }
> print "<img src=\"$img\">\n";
--
Hi, this piece is put automaticly under every mail from me.
Contact me: debot@xs4all.nl
Visit my page: http://www.debot.nl/
http://www.geocities.com/SunsetStrip/Frontrow/4346/top50index.html
I've much more homepage. You can just ask for them if you want.
Well, more I havn't to say, so have a nice day :-)
------------------------------
Date: Tue, 02 Feb 1999 15:14:59 +0100
From: Frank de Bot <debot@xs4all.nl>
Subject: Re: debug this script please
Message-Id: <36B70863.8A5D48C2@xs4all.nl>
you should use this SSi tag: <!--#exec cgi="/cgi-bin/yourscripts.pl"--> But
you must have an *.shtml file. Or the server doesn't support it.
"myname@mydomain.com" wrote:
> No, that was not the error.
> I just forgot to type it in the mail ;)
>
> Ok thank you everybody the script works !
> Can anybody tell me how I can call the script ?
> A SSI doesn't seem to work and in an image tag it won't work either.
> Do I have to link it directly in a frame or is there an other way ?
>
> Thank you,
>
> Peter
> Steve Palincsar heeft geschreven in bericht <36B648C0.26A885AC@his.com>...
> >myname@mydomain.com wrote:
> >>
> >> Can anyone tell me what is wrong with this script ?
> >> I really don't get it, I always get an internal server error.
> >> I chmod te files read/write/execute
> >>
> >> Please help,
> >>
> >> Peter
> >>
> >> netket@dma.be
> >>
> >> #!/usr/bin/perl -w
> >> use strict;
> >> srand;
> >> my $whichImg = rand(4);
> >> my $img;
> >> if ($whichImg < 1) <================== guess what is missing here
> >>
> >> $img = '1.gif';
> >> } <=================================== close brace. Where is the open
> brace?
> >> elsif ($whichImg < 2) <=============== and you've done it again
> >>
> >> $img = '2.gif';
> >> } <=================================== there's that close again; where
> is the open?
> >> elsif ($whichImg < 4) <=============== ditto
> >>
> >> $img = '3.gif';
> >> } <=================================== ditto once again
> >> print "<img src=\"$img\">\n";
--
Hi, this piece is put automaticly under every mail from me.
Contact me: debot@xs4all.nl
Visit my page: http://www.debot.nl/
http://www.geocities.com/SunsetStrip/Frontrow/4346/top50index.html
I've much more homepage. You can just ask for them if you want.
Well, more I havn't to say, so have a nice day :-)
------------------------------
Date: Tue, 02 Feb 1999 09:34:46 -0500
From: Rick Holt <holt@watson.ibm.com>
Subject: Getting the wildcard value
Message-Id: <36B70D06.FC56F44@watson.ibm.com>
I am attempting to extract the data from a line of HTML
using perl. For example, given the line:
<meta name="Author" content="Rick Holt">
If I want to extract the value of name, I know I can first
split on "name=" and then split on the double-quote. But
it seems like it ought to be possible to use a pattern like
/name=".*"/
and have the value of .* assigned somewhere.
------------------------------
Date: Tue, 2 Feb 1999 08:10:34 -0600
From: "Kim Long" <kiml@worldnetla.net>
Subject: locking/linking files - HELP
Message-Id: <36b706a6.0@209.4.101.246>
I have a book with this snippet of code for locking a file before
manipulation. However there are a few things I don't understand. Here
goes:
$PtmpTmp = "ptmp$$";
open(PTMPTMP,">$PtmpTmp") || die "Can't create temporary passwd file, $!\n";
close(PTMPTMP);
for ($i=1;$i<=60;$i++) {
$GotPtmp = link($PtmpTmp,"ptmp");
if ($GotPtmp) {
unlink $PtmpTmp;
($i == 1) || print "\n"; # If no dots, no newline
last;
}
($i == 1) && print "Waiting for lock on /etc/passwd\n";
print ".";
sleep 1;
}
$GotPtmp || &ABORT("\nCan't get lock on /etc/passwd");
The text description says "The passwd file needs to be locked to prevent
multiple processes.... Create a file called /etc/ptmp. The open system
call is not guaranteed to be atomic....link call will be atomic. Create a
file that can be linked to ptmp. Then loop up to 60 times trying to get the
lock. Remove temp file linked to ptmp. (give feedback to user in the form
of dots while looping through trying to get lock - waiting 1 sec between
loops) If lock couldn't be aquired, call ABORT ..."
Later:
open(PASSWD,"passwd") || &ABORT("Can't open /etc/passwd, $!");
open(PTMP,">ptmp") || &ABORT("Can't open /etc/ptmp, $!");
.
.
while (<PASSWD>) {
print PTMP;
Here's my question/s: (And I have tried RTM)....
1) I understand creating the file, but what is "$$" in $PtmpTmp = "ptmp$$"
?
2) My understanding is we need to link to the file in order to prevent it
from being changed, but I don't see a
link to the passwd file itself, only this temp file.
3) If we're linking to the temp of the temp to lock it, then why do we
unlink before anything is written to it?
I'm sure I'm simply missing a concept; I'm still new to Perl. I'm running
out of time to finish a project and I want to use this concept to lock my
file. - unless there's a easier/better way.
Please email to kiml@worldnetla.net as well as post.
All suggestions appreciated.
KimL
------------------------------
Date: Tue, 02 Feb 1999 09:40:33 -0500
From: Jim Davidson <jimdavidson@lucent.com>
Subject: ndbm store returned -1 error
Message-Id: <36B70E61.50C3588C@lucent.com>
Does anyone know what is causing the following error when using
'dbmopen' to store records from a flat file containing fixed length
records? Each record is 376 bytes long, the key length is 10 bytes and
the problem is random. If I create a file with just the failed record,
it works fine or if I remove the failed record it fails on another
record but not at the same record number(chunk).
Here is the error:
ndbm store returned -1, errno 2, key "0000027420" at loadit.pl.org line
68, <INFILE> chunk 1311.
Thanks in advance!
Jim Davidson
Lucent Technologies
------------------------------
Date: 2 Feb 1999 13:56:44 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: New posters to comp.lang.perl.misc
Message-Id: <79706s$pj4$2@info.uah.edu>
Following is a summary of articles from new posters spanning a 8 day
period, beginning at 25 Jan 1999 13:55:38 GMT and ending at
02 Feb 1999 10:25:03 GMT.
Notes
=====
- A line in the body of a post is considered to be original if it
does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
- All text after the last cut line (/^-- $/) in the body is
considered to be the author's signature.
- The scanner prefers the Reply-To: header over the From: header
in determining the "real" email address and name.
- Original Content Rating (OCR) is the ratio of the original content
volume to the total body volume.
- Find the News-Scan distribution on the CPAN!
<URL:http://www.perl.com/CPAN/modules/by-module/News/>
- Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
- Copyright (c) 1998 Greg Bacon. All Rights Reserved.
Verbatim copying and redistribution is permitted without royalty;
alteration is not permitted. Redistribution and/or use for any
commercial purpose is prohibited.
Totals
======
Posters: 277 (47.4% of all posters)
Articles: 393 (25.1% of all articles)
Volume generated: 636.4 kb (24.0% of total volume)
- headers: 273.5 kb (5,599 lines)
- bodies: 358.9 kb (11,913 lines)
- original: 275.1 kb (9,469 lines)
- signatures: 3.7 kb (78 lines)
Original Content Rating: 0.767
Averages
========
Posts per poster: 1.4
median: 1 post
mode: 1 post - 213 posters
s: 1.1 posts
Message size: 1658.3 bytes
- header: 712.5 bytes (14.2 lines)
- body: 935.2 bytes (30.3 lines)
- original: 716.9 bytes (24.1 lines)
- signature: 9.6 bytes (0.2 lines)
Top 10 Posters by Number of Posts
=================================
(kb) (kb) (kb) (kb)
Posts Volume ( hdr/ body/ orig) Address
----- -------------------------- -------
7 10.4 ( 5.2/ 5.2/ 4.2) Denis.Haskin@bigfoot.com
6 8.7 ( 4.2/ 4.4/ 2.8) Richard Nilsson <qdtrini@jdicms88.ericsson.se>
6 7.3 ( 3.6/ 3.7/ 2.9) "End User" <kimntodd@dontspamus.execpc.com>
6 7.6 ( 4.4/ 2.3/ 2.0) Ben Smith <bsmith@perf.zko.dec.com>
6 7.0 ( 4.8/ 2.2/ 1.0) billyBob@globalSpam.org
5 8.2 ( 2.8/ 5.4/ 5.0) "Quentin Compson" <bcompson@yahoo.com>
5 5.9 ( 3.2/ 2.7/ 1.5) kaz@eudoramail.com
5 8.2 ( 3.9/ 4.3/ 0.7) Jeff Kerrigan <jeff_kerrigan@hotmail.com>
4 8.1 ( 3.6/ 4.4/ 2.4) Gary Smiley <gasmiley@nospam.mediaone.net>
4 4.7 ( 3.0/ 1.8/ 1.5) Jeff Hester <jeff@toad.net>
These posters accounted for 3.5% of all articles.
Top 10 Posters by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Address
-------------------------- ----- -------
31.2 ( 1.4/ 29.8/ 22.7) 2 Cynthia Guessregen <cindyg12@bellsouth.net>
12.6 ( 1.8/ 10.7/ 6.6) 3 "Kostyantyn Chromyak" <chromyak@usa.net>
10.4 ( 5.2/ 5.2/ 4.2) 7 Denis.Haskin@bigfoot.com
8.7 ( 4.2/ 4.4/ 2.8) 6 Richard Nilsson <qdtrini@jdicms88.ericsson.se>
8.4 ( 1.4/ 7.0/ 4.1) 2 "maf" <8_maf_8@usa.net>
8.2 ( 2.8/ 5.4/ 5.0) 5 "Quentin Compson" <bcompson@yahoo.com>
8.2 ( 3.9/ 4.3/ 0.7) 5 Jeff Kerrigan <jeff_kerrigan@hotmail.com>
8.1 ( 3.6/ 4.4/ 2.4) 4 Gary Smiley <gasmiley@nospam.mediaone.net>
7.6 ( 4.4/ 2.3/ 2.0) 6 Ben Smith <bsmith@perf.zko.dec.com>
7.3 ( 3.6/ 3.7/ 2.9) 6 "End User" <kimntodd@dontspamus.execpc.com>
These posters accounted for 4.2% of the total volume.
Top 10 Posters by OCR (minimum of three posts)
==============================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
1.000 ( 0.3 / 0.3) 3 "Colbert Philippe" <colbert@nh.ultranet.com>
1.000 ( 2.8 / 2.8) 3 Robbin <Robbin.Brahms@trw.com>
1.000 ( 2.3 / 2.3) 3 dlunday@airmail.net (Duane Lunday)
0.982 ( 3.6 / 3.7) 3 Danny Paxton <paxtond@ix.netcom.com>
0.970 ( 5.2 / 5.4) 3 "Shanx" <mkshanx@ust.hk>
0.943 ( 1.6 / 1.7) 3 mwebster@inetarena.com
0.930 ( 3.6 / 3.8) 3 lars@larsshack.org
0.924 ( 5.0 / 5.4) 5 "Quentin Compson" <bcompson@yahoo.com>
0.882 ( 1.3 / 1.5) 3 "Eric Gorely" <eric.gorely@mci.com>
0.864 ( 2.0 / 2.3) 6 Ben Smith <bsmith@perf.zko.dec.com>
Bottom 10 Posters by OCR (minimum of three posts)
=================================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
0.691 ( 1.9 / 2.7) 4 halxd2@my-dejanews.com
0.633 ( 1.0 / 1.6) 3 Nuno Leitao <nuno.leitao@uk.uu.net>
0.623 ( 2.8 / 4.4) 6 Richard Nilsson <qdtrini@jdicms88.ericsson.se>
0.616 ( 1.5 / 2.4) 4 mark.c.hamlin@bt.com
0.613 ( 6.6 / 10.7) 3 "Kostyantyn Chromyak" <chromyak@usa.net>
0.573 ( 1.5 / 2.7) 5 kaz@eudoramail.com
0.544 ( 2.4 / 4.4) 4 Gary Smiley <gasmiley@nospam.mediaone.net>
0.480 ( 1.5 / 3.1) 4 Paul Bruno <paullyb8@fnol.net>
0.449 ( 1.0 / 2.2) 6 billyBob@globalSpam.org
0.170 ( 0.7 / 4.3) 5 Jeff Kerrigan <jeff_kerrigan@hotmail.com>
25 posters (9%) had at least three posts.
Top 10 Crossposters
===================
Articles Address
-------- -------
20 Barbara Day <bjday@sonic.net>
10 spiderfighter@REMOVETHISTOEMAILMEhotmail.com (Spider Fighter)
10 "Marc Baime" <mbaime@gte.net>
9 grendal@buffnet.net
8 "Olice (Oly) Certain" <ocertain@webwide.net>
6 "Kevin Keil" <kevink@NOSPAMinfograph.com>
3 rickert@cs.niu.edu (Neil Rickert)
3 Nishant Shah <nishants@usc.edu>
3 logan_shaw@yahoo.com
3 mark.c.hamlin@bt.com
------------------------------
Date: Tue, 02 Feb 1999 13:47:32 GMT
From: topmind@technologist.com
Subject: Re: Perl Criticism
Message-Id: <796vlh$1n0$1@nnrp1.dejanews.com>
In article <slrn7b9ujh.4tu.sholden@pgrad.cs.usyd.edu.au>,
sholden@cs.usyd.edu.au wrote:
> [...]
>
> Anyway I await your explanation (taking it to only mail would be good, since
> most people really don't want to hear I suspect).
>
It may take a day or two to build the samples. I will get back
to you shortly on pointerless structures.
Anyhow, most people don't want to hear because they have been
much more consumed with personal and social issues rather
than technical issues.
> --
> Sam
>
> Basically, avoid comments. If your code needs a comment to be
> understood, it would be better to rewrite it so it's easier to
> understand. --Rob Pike
>
I disagree with that statement. Sometimes one comment
will nicely summarize a dozen or so lines of code. Also,
by hinting the reader about the code BEFORE they read
it helps them figure it out faster. Otherwise, one
pass is needed to make a guess, and a second to verify
the guess.
For example, "sort list" takes only two
seconds to understand. However, if somebody stumbled upon
sorting code without knowing what it does, it would
usually take them several minutes to figure out
what it is doing. Those two words are a bargain.
Further, if there is a bug, then reading only the code
may not indicate what was INTENDED. Only comments can
tell what was intended.
-tmind-
http://www.geocities.com/SiliconValley/Lab/6888/langopts.htm
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 2 Feb 1999 14:09:18 -0000
From: "Simon GIllespie" <simon.gillespie@virgin.com>
Subject: Perl in ASP code
Message-Id: <79711h$p1o$1@nclient3-gui.server.virgin.net>
Having real problems getting ASP's Folder object's File collection to work.
Anyone know of any useful "using Perl for ASP" URL's or books ?
Thanks,
Simon Gillespie.
------------------------------
Date: Tue, 02 Feb 1999 15:22:21 +0100
From: Frank de Bot <debot@xs4all.nl>
Subject: Re: Perl syntax ( URGENT )
Message-Id: <36B70A1C.CC892B70@xs4all.nl>
kamez@my-dejanews.com wrote:
> hi everybody,
>
> could anyone explain me in detail the meaning of the following lines
> in Perl ( i'm not familiar with ) , so it'll help to better understand
> to do other stuff :
> 1)
>
> chop ------------> what's the meaning of "chop" ?
>
Chop get the \n of a string. chop($var);
> $line=$_;
> $line =~ s/\s+/ /g; ------------------->?
>
This makes a lot a spaces just one. If you have this text: Hello
Everybody . It would be: Hello Everybody.
> @arr= split; ------------------->?
Split makes from a string an array. This seems to do nothing. Use: @array =
split(/ /, $string). Every word has it own place in the array
>
> @val=split(/:/,arr[2]); $tt=val[0]; -------->?
Some more difficult to explain. I do it with examples. This is now the
Array. Each value separted by an space. Val1 Val2 Val3 Val4
You can call the them by this:
$val[0] (should be Val1)
$val[2] (should be Val3)
$tt is the first value in the array.
>
>
> 2)
>
> if ( ( index(line,"http-gw") !=-1)
> && ( index(line,"out=") !=-1) ) {
> @array=grep(/^in=/,@arr);
> @val=split(/=/,array[0]); in=val[1];
> @array=grep(/^out=/,@arr);
> @val=split(/=/,array[0]); out=val[1];
> if (index(line,pcnserver) >= 0 ) {
> t_pcn+=in+out;
It's just a part from a script. Can explain anything about it.
>
>
> Thanks for taking time to read this,
> Thanks a lot for your help,
> Khalid.
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
--
Hi, this piece is put automaticly under every mail from me.
Contact me: debot@xs4all.nl
Visit my page: http://www.debot.nl/
http://www.geocities.com/SunsetStrip/Frontrow/4346/top50index.html
I've much more homepage. You can just ask for them if you want.
Well, more I havn't to say, so have a nice day :-)
------------------------------
Date: Tue, 2 Feb 1999 14:34:57 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Question about Regular Expression
Message-Id: <ebohlmanF6J769.9C8@netcom.com>
kaz@eudoramail.com wrote:
: A part of my CGI get a value of referer. I am trying to take out only the
: middle part of each value. Ex. if
: http://www.example.com/yyyy/zzzz/index.html, I need only the part of
: yyyy/zzzz. Values of directories and page name are different each time
: depends on from where people accessed. I tried to use (.*) expression. if
: ($ddd eq "http://www.example.com/(.*)/index.html")
I think the URI::URL module will be very helpful here.
------------------------------
Date: Tue, 2 Feb 1999 14:09:35 -0000
From: "Guillaume Buat-Menard" <guillaume@nospam.com>
Subject: read an html from a url
Message-Id: <7971am$rfc$1@newsreader2.core.theplanet.net>
Hi All,
I know there are some packages dedicated to the internet etc...
The problem is that I don't want to download or install any package because
I'm not gonna run the script on my test server but on another server that I
don't know yet.
I just need to find a routine or a compact package that will allow me to
read an HTML (or text) page from a designated URL
(http://theserver.com/myfile.html). I would like to run this package or
routine on NT and UNIX with perl 5.
Thanks for your help,
Guillaume.
------------------------------
Date: Tue, 2 Feb 1999 14:40:42 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: read an html from a url
Message-Id: <ebohlmanF6J7Fu.9tG@netcom.com>
Guillaume Buat-Menard <guillaume@nospam.com> wrote:
: I know there are some packages dedicated to the internet etc...
: The problem is that I don't want to download or install any package because
: I'm not gonna run the script on my test server but on another server that I
: don't know yet.
: I just need to find a routine or a compact package that will allow me to
: read an HTML (or text) page from a designated URL
: (http://theserver.com/myfile.html). I would like to run this package or
: routine on NT and UNIX with perl 5.
Why re-invent the wheel? Use LWP. If the administrator of the server
you're going to use lets you run code you wrote yourself, but not tested,
public code that others wrote, find another server. If worse comes to
worse, copy-and-paste the code from LWP::Simple into your program. But
first read the FAQ on how to install modules in your personal directories
if you aren't allowed to install them system-wide.
------------------------------
Date: 2 Feb 1999 14:39:33 GMT
From: Ed Hitler <revjack@radix.net>
Subject: Regex for e-mail addresses?
Message-Id: <7972n5$4ac$1@news1.Radix.Net>
Keywords: Hexapodia as the key insight
Is there a single perl regular expression that will allow me to extract the
e-mail addresses from the following header lines?
From: joe@blow.com
From: Joe (joe@blow.com)
From: Joe Blow (joe@blow.com)
From: <joe@blow.com>
From: (joe@blow.com)
From: "joe@blow.com" <joe@blow.com>
From: joe@blow.com-nospam
From: Joe "Remove the DotFrom: joe@blow.com-nospam
From: #joe#@blow.com
etc.
Right now I'm doing something like this:
$_ =~ s/^.*[ <(]([^ ]+\@[^ ]+)[ >)].*/$1/;
$_ =~ s/From: //;
There's got to be a better way.
(Note - I'm calculating newsgroup posting statistics, not authoring a
spambot.)
Thanks in advance for any help you can lend.
--
/~\ Diebold ASTM connector Abo spot psychoses corralled duplicate S
C oo Bridgewater singular fiance Manhattan Locke whirlwind threw cin
_( ^) 1 , 0 0 0 , 0 0 0 m o n k e y s c a n ' t b e w r o n g
/___~\ http://3509641275/~revjack 02/02/99 09:31:15 revjack@radix.net
------------------------------
Date: Tue, 02 Feb 1999 14:23:53 GMT
From: droby@copyright.com
Subject: Re: Request for negative value list indexes
Message-Id: <7971pe$3nl$1@nnrp1.dejanews.com>
In article <1dmi8rr.buk54m1olrdxmN@bay2-74.quincy.ziplink.net>,
rjk@linguist.dartmouth.edu (Ronald J Kimball) wrote:
> Bart Lateur <bart.lateur@skynet.be> wrote:
>
> > A) add an extra special variable, that acts as $#ary, but for the list
> > you're trying to take a slice off; for exampl $#. ; $#_ is already in
> > use for the array @_ .
>
> And $#. is already in use for the array @. . ;-)
>
Not on my my machine.
Not that I'd consider using it outside a sig, but I was curious, so I tried.
No trouble making and using an array named @. but use of $#. seems to always
yield a syntax error.
This is probably a feature. ;-)
perl 5.005_02 on Solaris, Linux and NT.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 2 Feb 1999 13:47:08 GMT
From: SHILUV Ishay Azoulay 2801 <ishay@cpm.elex.co.il>
Subject: reused functions.
Message-Id: <Pine.HPP.3.96.990202154133.11239D-100000@tlhuph48.elex.co.il>
Hi,
I need help on reused functions.
Few functions are used many times in many script.
How do I reuse these functions without copying
their code everywhere.
=F8=A4=BA=B0`=B0=BA=A4=F8,=B8=B8,=F8=A4=BA=B0`=B0=BA=A4=F8,=B8=F8=A4=BA=B0`=
=B0=BA=A4=F8,=B8=B8,=F8=A4=BA=B0`=B0
Regards, Ishay
Phone : 2801 08-9134734
Mail_to : ishay.azoulay@telrad.co.il
=F8=A4=BA=B0`=B0=BA=A4=F8,=B8=B8,=F8=A4=BA=B0`=B0=BA=A4=F8,=B8=B8,=F8=A4=BA=
=B0`=B0=BA=A4=F8,=B8,=F8=A4=BA=B0`
------------------------------
Date: Tue, 2 Feb 1999 14:36:15 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: reused functions.
Message-Id: <ebohlmanF6J78F.9Hp@netcom.com>
SHILUV Ishay Azoulay 2801 <ishay@cpm.elex.co.il> wrote:
: I need help on reused functions.
: Few functions are used many times in many script.
: How do I reuse these functions without copying
: their code everywhere.
perldoc perlmod
------------------------------
Date: 2 Feb 1999 13:56:43 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <79706r$pj4$1@info.uah.edu>
Following is a summary of articles spanning a 8 day period,
beginning at 25 Jan 1999 13:55:38 GMT and ending at
02 Feb 1999 10:25:03 GMT.
Notes
=====
- A line in the body of a post is considered to be original if it
does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
- All text after the last cut line (/^-- $/) in the body is
considered to be the author's signature.
- The scanner prefers the Reply-To: header over the From: header
in determining the "real" email address and name.
- Original Content Rating (OCR) is the ratio of the original content
volume to the total body volume.
- Find the News-Scan distribution on the CPAN!
<URL:http://www.perl.com/CPAN/modules/by-module/News/>
- Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
- Copyright (c) 1998 Greg Bacon. All Rights Reserved.
Verbatim copying and redistribution is permitted without royalty;
alteration is not permitted. Redistribution and/or use for any
commercial purpose is prohibited.
Excluded Posters
================
perlfaq-suggestions\@mox\.perl\.com
Totals
======
Posters: 584
Articles: 1565 (568 with cutlined signatures)
Threads: 508
Volume generated: 2651.2 kb
- headers: 1154.8 kb (22,905 lines)
- bodies: 1399.8 kb (45,000 lines)
- original: 947.0 kb (32,700 lines)
- signatures: 95.0 kb (2,024 lines)
Original Content Rating: 0.677
Averages
========
Posts per poster: 2.7
median: 1.0 post
mode: 1 post - 372 posters
s: 5.3 posts
Posts per thread: 3.1
median: 2.0 posts
mode: 1 post - 180 threads
s: 4.3 posts
Message size: 1734.7 bytes
- header: 755.6 bytes (14.6 lines)
- body: 915.9 bytes (28.8 lines)
- original: 619.6 bytes (20.9 lines)
- signature: 62.2 bytes (1.3 lines)
Top 10 Posters by Number of Posts
=================================
(kb) (kb) (kb) (kb)
Posts Volume ( hdr/ body/ orig) Address
----- -------------------------- -------
54 84.7 ( 40.5/ 34.1/ 32.9) abigail@fnx.com
44 71.3 ( 25.5/ 45.8/ 28.9) tadmc@metronet.com (Tad McClellan)
41 54.9 ( 34.2/ 17.6/ 10.4) Jonathan Feinberg <jdf@pobox.com>
39 70.7 ( 25.0/ 41.4/ 25.5) lr@hpl.hp.com (Larry Rosler)
37 70.3 ( 33.0/ 27.6/ 14.7) rjk@linguist.dartmouth.edu (Ronald J Kimball)
31 56.7 ( 27.0/ 29.6/ 19.1) Staffan Liljas <staffan@ngb.se>
25 50.5 ( 21.0/ 24.3/ 15.9) mgjv@comdyn.com.au (Martien Verbruggen)
25 55.3 ( 22.2/ 30.0/ 15.8) sholden@cs.usyd.edu.au
22 35.9 ( 17.2/ 18.7/ 18.5) fl_aggie@thepentagon.com (I R A Aggie)
22 77.0 ( 23.9/ 53.1/ 19.0) topmind@technologist.com
These posters accounted for 21.7% of all articles.
Top 10 Posters by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Address
-------------------------- ----- -------
84.7 ( 40.5/ 34.1/ 32.9) 54 abigail@fnx.com
77.0 ( 23.9/ 53.1/ 19.0) 22 topmind@technologist.com
71.3 ( 25.5/ 45.8/ 28.9) 44 tadmc@metronet.com (Tad McClellan)
70.7 ( 25.0/ 41.4/ 25.5) 39 lr@hpl.hp.com (Larry Rosler)
70.3 ( 33.0/ 27.6/ 14.7) 37 rjk@linguist.dartmouth.edu (Ronald J Kimball)
56.7 ( 27.0/ 29.6/ 19.1) 31 Staffan Liljas <staffan@ngb.se>
55.3 ( 22.2/ 30.0/ 15.8) 25 sholden@cs.usyd.edu.au
54.9 ( 34.2/ 17.6/ 10.4) 41 Jonathan Feinberg <jdf@pobox.com>
50.5 ( 21.0/ 24.3/ 15.9) 25 mgjv@comdyn.com.au (Martien Verbruggen)
35.9 ( 17.2/ 18.7/ 18.5) 22 fl_aggie@thepentagon.com (I R A Aggie)
These posters accounted for 23.7% of the total volume.
Top 10 Posters by OCR (minimum of five posts)
==============================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
1.000 ( 1.4 / 1.4) 5 hamlinm@boat.bt.com
1.000 ( 4.8 / 4.8) 7 haslawww@friko7.onet.pl (Best Passwords to sex pages )
0.988 ( 18.5 / 18.7) 22 fl_aggie@thepentagon.com (I R A Aggie)
0.971 ( 5.3 / 5.5) 7 23_skidoo@geocities.com
0.964 ( 32.9 / 34.1) 54 abigail@fnx.com
0.924 ( 5.0 / 5.4) 5 "Quentin Compson" <bcompson@yahoo.com>
0.864 ( 2.0 / 2.3) 6 Ben Smith <bsmith@perf.zko.dec.com>
0.836 ( 9.7 / 11.6) 11 Daniel Grisinger <dgris@moiraine.dimensional.com>
0.817 ( 6.8 / 8.3) 9 "Charles R. Thompson" <design@raincloud-studios.com>
0.813 ( 11.5 / 14.1) 9 jc@eddie.mit.edu
Bottom 10 Posters by OCR (minimum of five posts)
=================================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
0.461 ( 4.4 / 9.5) 6 Richard Walker <Richard.Walker@west-server.com>
0.449 ( 1.0 / 2.2) 6 billyBob@globalSpam.org
0.441 ( 4.1 / 9.3) 12 merlyn@stonehenge.com (Randal L. Schwartz)
0.429 ( 4.7 / 11.0) 15 Abraham Grief <abey@hill.ucr.edu>
0.414 ( 2.2 / 5.3) 11 comdog@computerdog.com (brian d foy)
0.405 ( 4.3 / 10.5) 8 Rick Delaney <rick.delaney@home.com>
0.358 ( 19.0 / 53.1) 22 topmind@technologist.com
0.315 ( 3.4 / 10.7) 18 Eugene Sotirescu <eugene@snailgem.org>
0.282 ( 1.5 / 5.3) 9 Tom Briles <tbriles@austin.ibm.com>
0.170 ( 0.7 / 4.3) 5 Jeff Kerrigan <jeff_kerrigan@hotmail.com>
65 posters (11%) had at least five posts.
Top 10 Threads by Number of Posts
=================================
Posts Subject
----- -------
55 Perl Criticism
31 system function, Pros and Cons??
23 Perl Criticism [summary]
20 How long would the Unixes last without Perl?
19 HELP with string parsing and scoring
17 Visual Perl?
15 ok please don't shoot me for this question
15 Stopping a foreach loop
15 dupes in Perl
15 Help on deleting an item in an array?
These threads accounted for 14.4% of all articles.
Top 10 Threads by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Subject
-------------------------- ----- -------
156.9 ( 58.3/ 95.4/ 53.9) 55 Perl Criticism
61.6 ( 24.8/ 34.6/ 25.1) 31 system function, Pros and Cons??
59.2 ( 21.8/ 36.2/ 20.2) 23 Perl Criticism [summary]
41.2 ( 3.9/ 36.9/ 26.1) 5 [Perl] How to find the Perl FAQ
39.1 ( 14.8/ 21.7/ 13.1) 19 HELP with string parsing and scoring
36.6 ( 17.4/ 17.3/ 11.5) 20 How long would the Unixes last without Perl?
27.9 ( 10.6/ 16.3/ 9.5) 15 dupes in Perl
25.3 ( 12.1/ 11.1/ 5.3) 15 ok please don't shoot me for this question
24.3 ( 5.7/ 18.6/ 9.7) 9 CGI form processing
23.8 ( 9.3/ 13.2/ 7.5) 12 Perl Crashes IIS4!
These threads accounted for 18.7% of the total volume.
Top 10 Threads by OCR (minimum of five posts)
==============================================
(kb) (kb)
OCR orig / body Posts Subject
----- -------------- ----- -------
0.913 ( 2.6/ 2.9) 6 Can you pattern match using an array?
0.870 ( 1.6/ 1.9) 5 database in perl
0.846 ( 6.9/ 8.1) 6 How to support both short and long option styles?
0.830 ( 3.6/ 4.3) 5 Can you launch a background process from web page?
0.827 ( 2.0/ 2.4) 5 cgi in perl
0.791 ( 3.5/ 4.5) 5 Using a variable as a variable name
0.789 ( 1.8/ 2.3) 6 Finding/Printing system uptime in perl
0.781 ( 8.5/ 10.8) 8 alternative perl NG for newbies?
0.766 ( 5.9/ 7.7) 5 Email script ..seems to be working.. anything overlooked
0.766 ( 6.7/ 8.7) 7 Anyone know of a stock quote script?
Bottom 10 Threads by OCR (minimum of five posts)
=================================================
(kb) (kb)
OCR orig / body Posts Subject
----- -------------- ----- -------
0.496 ( 1.9 / 3.9) 5 HELP - with redirect of STDERR and STDOUT
0.496 ( 7.6 / 15.4) 7 Can't assign an array to a hash key in a dbm file?
0.494 ( 2.1 / 4.3) 5 Gosh, s// faster than m// (was Re: Counting characters with tr/// (in perl))
0.473 ( 5.3 / 11.1) 15 ok please don't shoot me for this question
0.456 ( 1.5 / 3.3) 6 The behaviour of split()
0.443 ( 2.3 / 5.1) 7 A little help, thanks.
0.433 ( 2.1 / 4.8) 6 Sorting an Array
0.377 ( 2.2 / 5.8) 5 Jesus Rides a HOG(tm) : was :CONCLUSIVE PROOF: The Beatles are bigger than Jesus!
0.331 ( 1.8 / 5.4) 5 CONCLUSIVE PROOF: The Beatles are bigger than Jesus!
0.296 ( 0.9 / 3.0) 6 Newbie question: writing file
83 threads (16%) had at least five posts.
Top 10 Targets for Crossposts
=============================
Articles Newsgroup
-------- ---------
41 comp.lang.perl.modules
16 comp.lang.perl.moderated
14 comp.lang.perl
10 rec.arts.sf.tv
10 rec.motorcycles.harley
10 alt.prophecies.cayce
10 comp.sys.ibm.pc.hardware.chips
10 rec.arts.sf.written.robert-jordan
10 alt.prophecies.nostradamus
10 rec.music.beatles
Top 10 Crossposters
===================
Articles Address
-------- -------
196 haslawww@friko7.onet.pl (Best Passwords to sex pages )
25 kd4zkw@amsat.org
20 Barbara Day <bjday@sonic.net>
10 joemama@roundtrip.net
10 "Marc Baime" <mbaime@gte.net>
10 spiderfighter@REMOVETHISTOEMAILMEhotmail.com (Spider Fighter)
9 grendal@buffnet.net
8 "Olice (Oly) Certain" <ocertain@webwide.net>
7 Jonathan Feinberg <jdf@pobox.com>
6 "Kevin Keil" <kevink@NOSPAMinfograph.com>
------------------------------
Date: Tue, 2 Feb 1999 09:03:57 -0500
From: "Altair" <acetone@bigfoot.com>
Subject: submit a form and Perl question
Message-Id: <36b70741.0@news.cyberzone.net>
Hi !
Is it possible to submit the form content by clicking on a
simple HTML link ?
(NOT a classic input submit button)
If so, how to do that in Perl ?
Thank you
Jean
------------------------------
Date: Tue, 2 Feb 1999 14:37:54 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: submit a form and Perl question
Message-Id: <ebohlmanF6J7B6.9Kq@netcom.com>
Altair <acetone@bigfoot.com> wrote:
: Is it possible to submit the form content by clicking on a
: simple HTML link ?
: (NOT a classic input submit button)
Not without some sort of client-side scripting, which is not particularly
reliable for this sort of thing.
: If so, how to do that in Perl ?
Use Perl as a client-side scripting language :)
------------------------------
Date: Tue, 02 Feb 1999 09:28:40 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Using Net
Message-Id: <fl_aggie-0202990928400001@aggie.coaps.fsu.edu>
In article <36b62efa.0@queeg.apci.net>, "John Corbin" <jcorbin@apci.net> wrote:
+ I have run across a line in a source file that reads;
+
+ use Net::Telnet;
+
+ When I try to use this source it says;
+
+ Can't locate Net/Telnet.pm in @INC (@INC contains: C:\PERL\lib\site
+ C:\PERL\lib
+ c:\perl\lib c:\perl\lib\site c:\perl\lib\site .) at finger.pl line 1.
+ BEGIN failed--compilation aborted at finger.pl line 1.
+
+ I looked thru the FAQ but cant seem to find anything that pertains to
+ this....whats the problem.
Ummm...you probably don't have Net::Telnet installed? See if you can
install it, look to the CPAN nearest you.
James
------------------------------
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 4805
**************************************