[15788] in Perl-Users-Digest
Perl-Users Digest, Issue: 3201 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 29 21:05:22 2000
Date: Mon, 29 May 2000 18:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <959648710-v9-i3201@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 29 May 2000 Volume: 9 Number: 3201
Today's topics:
adding values to an anonymous array <paul@partitura.com>
Re: Bout mailhandling <idamhNOidSPAM@mailcity.com.invalid>
Re: Call me <jfw@saltmine.radix.net>
Re: cgi script that lets users post movie and book revi <rob13@rock13.com>
Re: Converting an alphanumeric string into an integer n <lr@hpl.hp.com>
Re: Converting an alphanumeric string into an integer n (Neil Kandalgaonkar)
Re: directory permissions in NT <bwalton@rochester.rr.com>
Re: directory permissions in NT <lr@hpl.hp.com>
Re: Dynamically assigning $variable name? (Bart Lateur)
File Array <hoho110@gmx.de>
Re: HALL OF SHAME :-) <flavell@mail.cern.ch>
Re: HALL OF SHAME :-) <callgirl@la.znet.com>
Re: HALL OF SHAME :-) <Tbone@pimpdaddy.com>
Re: HALL OF SHAME :-) <thoren@southern-division.com>
Re: HALL OF SHAME :-) <thoren@southern-division.com>
Re: HALL OF SHAME :-) (Kai Henningsen)
Re: Help - I've been spammed with PERL (Monte)
Newbie: Pattern Match Question <president@webticker.com>
Re: Newbie: Pattern Match Question <tina@streetmail.com>
Re: PERL and UDP Source port? (Che-Ming Chang)
Re: Perl CGI Script to generate web site statistics <s0218327@unix1.cc.ysu.edu>
Re: Perl unusable as a programming language <Tbone@pimpdaddy.com>
Re: Question: Fileupload using cgi-lib.pl (David Efflandt)
Re: scoping trouble with nested structures <bwalton@rochester.rr.com>
Re: Waxing Philosophical <dave@dave.org.uk>
Re: Waxing Philosophical <Tbone@pimpdaddy.com>
Re: Waxing Philosophical <Tbone@pimpdaddy.com>
Re: Waxing Philosophical <thoren@southern-division.com>
Re: Waxing Philosophical (Kai Henningsen)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 29 May 2000 20:04:25 -0500
From: Paul Phillips <paul@partitura.com>
Subject: adding values to an anonymous array
Message-Id: <7CF9BC1EB3804753.8CA4FB419D524559.194777D90A5D4821@lp.airnews.net>
I am a Perl novice, and am exploring the intricacies of references and
anonymous arrays.
I understand that I can create an anonymous table like this:
$table_ref = [
[1,2,3],
[4,5,6],
[7,8,9],
];
I understand how and why this works. (Thank you Damian Conway.)
Now, how do I go about adding another row to this table?
The only way I can think of is to dereference the array, then assign it
to a scalar, thereby determining the numbers of rows.
$rows = @$table_ref;
Then I can use this number to add to the anonymous array,
$Table_ref->[$rows] = [10,11,12];
Is there a better, or more elegant way? If so, and you want to share
it, please explain it, as I'm still struggling with these concepts.
For that matter, if I type:
$rows = @$table_ref;
and the table is empty (nothing having been assigned yet) Perl complains
about use of an unitialized value if the -w switch is on.
Is this OK? Is there a better way to test if the table is empty?
Thanks!!
Paul Phillips
------------------------------
Date: Mon, 29 May 2000 15:30:22 -0700
From: Fake51 <idamhNOidSPAM@mailcity.com.invalid>
Subject: Re: Bout mailhandling
Message-Id: <0ab4be79.69a40cb0@usw-ex0103-018.remarq.com>
Cheers
But the prob's a bit bigger than that (I realized) and this
could be the wrong news group (with my luck prolly is). It has
to be automated, so letting a perl script feed thru incoming
mails is mighty fine, but how do i trigger the script when a new
mail has arrived in the box? System is unix. Any help be
appreciated.
Fake
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
Date: 29 May 2000 22:52:20 GMT
From: Jim Ward <jfw@saltmine.radix.net>
Subject: Re: Call me
Message-Id: <8gusb4$gd4$1@news1.Radix.Net>
Abigail <abigail@arena-i.com> wrote:
> On 26 May 2000 20:31:25 GMT, Jim Ward <jfw@saltmine.radix.net> wrote:
> ++ I wrote a Perl script that uses lynx to monitor a webpage. When
> ++ a button on the page goes red, it e-mails me. Can anyone suggest
> ++ a way for it to also call me? I'm on a UNIX machine, with a modem,
> ++ I'm thinking I record a message ... use cu ...?
> Is there any Perl specific part in your question? I don't think so.
Cheeky wench!
Is there a Perl module I can use to make a telephone call? Is there
any Perl telephony support?
------------------------------
Date: Mon, 29 May 2000 18:56:21 -0400
From: Rob <rob13@rock13.com>
Subject: Re: cgi script that lets users post movie and book reviews on website?
Message-Id: <3932F595.D41DC280@rock13.com>
calderas@my-deja.com wrote:
>
> yeah, and i couldnt find exactly what i was looking for there... there
> are polling scripts but none that seemed to allow for ratings,
> comments, and calculating the ratings...
>
Well typically it is difficult to find an exact script. You may have
to modify one or write your own. Your essentially wanting a guestbook
script and one could be used easily enough - though if you want to do
calculations with the ratings then that's a different story.
I do recall seeing a 'book club' script at cgi-resources, it may be
what you're after. Perhaps in the misc section...
--
Rob
http://rock13.com/webhelp/
Fight Spam - http://www.cauce.org/
------------------------------
Date: Mon, 29 May 2000 15:12:28 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Converting an alphanumeric string into an integer number
Message-Id: <MPG.139c8b2557c1e14e98aafe@nntp.hpl.hp.com>
In article <slrn8j5eg2.tgf.marcel@codewerk.com>, marcel@codewerk.com
says...
> On Mon, 29 May 2000 16:36:34 GMT, Ala Qumsieh <aqumsieh@hyperchip.com> wrote:
> >
> >Diablito <diab.litoNOdiSPAM@usa.net.invalid> writes:
> >
> >> I have a variable 'word' (letters and numbers) and I want to
> >> convert that into an integer in the range of 1-100.
> >> I need something like a=1,b=2,c=3,...Then I want the script to
> >> calculate a x variable:(example) if word is 'dog' x=26,if
> >> it's 'cat' x=23 and so on.
> >
> >In the spirit of Perl Golf, here's a couple of oneliners:
> >
> > $x += ord($_) - 96 for split //, $word;
> > $x+=ord($_)-96for split//,$word; # above without spaces
> > $x+=ord($_)-96for$word=~/\S/g;
>
> Save two strokes:
>
> $x+=ord()-96for$word=~/\S/g;
Save two more strokes:
$x-=96-ord for$word=~/./g;
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 29 May 2000 22:26:44 GMT
From: nj_kanda@alcor.concordia.ca (Neil Kandalgaonkar)
Subject: Re: Converting an alphanumeric string into an integer number
Message-Id: <8guqr4$ec8$1@newsflash.concordia.ca>
In article <slrn8j5eg2.tgf.marcel@codewerk.com>,
Marcel Grunauer <marcel@codewerk.com> wrote:
>On Mon, 29 May 2000 16:36:34 GMT, Ala Qumsieh <aqumsieh@hyperchip.com> wrote:
>>In the spirit of Perl Golf, here's a couple of oneliners:
>>
>> $x += ord($_) - 96 for split //, $word;
>> $x+=ord($_)-96for split//,$word; # above without spaces
>> $x+=ord($_)-96for$word=~/\S/g;
>
>Save two strokes:
>
> $x+=ord()-96for$word=~/\S/g;
$x-=96-ord for$word=~/\S/g; # Ha!
--
Neil Kandalgaonkar
neil@brevity.org
------------------------------
Date: Mon, 29 May 2000 22:47:09 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: directory permissions in NT
Message-Id: <3932F3AC.185E094A@rochester.rr.com>
scumjr@my-deja.com wrote:
>
> I've just started playing around with Perl (on an NT 4 system) and am
> scanning through directories gathering various statistics. I want to
> report on directories that I do not have access to and I've tried all
> of the file tests, but none of them appear to work (although the tests
> to check whether or not it is a directory works fine). I've tried
> using the full path name and just the directory name itself, but the
> tests always come back "true". Are these tests only valid for Unix
> systems? I've looked through the documentation and could see no
> mention of them not working on an NT system.
>
> If these tests do not work on NT what options do I have to check for
> permissions?
>
> Thanks in advance,
>
> SJ
...
Maybe Win32::FileSecurity would help?
--
Bob Walton
------------------------------
Date: Mon, 29 May 2000 16:53:35 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: directory permissions in NT
Message-Id: <MPG.139ca2d3aeb85b7698aaff@nntp.hpl.hp.com>
In article <8guf78$qv2$1@nnrp1.deja.com>, scumjr@my-deja.com says...
> I've just started playing around with Perl (on an NT 4 system) and am
> scanning through directories gathering various statistics. I want to
> report on directories that I do not have access to and I've tried all
^^^^^^^^^^^^^^^^^^^^^^^
I wouldn't expect that to work on any system.
> of the file tests, but none of them appear to work (although the tests
> to check whether or not it is a directory works fine). I've tried
> using the full path name and just the directory name itself, but the
^^^^^^^^^^^^^^^^^^^^^^^^
You must use the full path name unless the directory is the current
directory.
> tests always come back "true".
Even the ones that are complementary (-z and -s)?
> Are these tests only valid for Unix
> systems? I've looked through the documentation and could see no
> mention of them not working on an NT system.
They should work on NT systems, though some may have somewhat different
semantics from Unix (-C means 'creation time', not 'inode-change time'),
and some may have no semantics (-l and others).
> If these tests do not work on NT what options do I have to check for
> permissions?
Why not post a short self-sufficient segment of code that fails. Though
not able to run it on your system, maybe we can see what you may have
overlooked.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 29 May 2000 22:12:22 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Dynamically assigning $variable name?
Message-Id: <3933e51f.5856982@news.skynet.be>
Rachel Polanskis wrote:
>In fact I was asking a question that I didn't know the answer to,
>hoping I could answer it for someone else who (me being the so-called guru)
>asked it of me. I couldn't answer the question myself so came
>here asking and hoping for advice from a professional.
And you got your advice: DON'T DO IT.
I could go on and on for hopurs for why it is a bad idea, but instead,
I'll point you to the well-written articles (there are three) by
Mark-Jason Dominus.
Why it's stupid to `use a variable as a variable name'
http://www.plover.com/~mjd/perl/varvarname.html
http://www.plover.com/~mjd/perl/varvarname2.html
http://www.plover.com/~mjd/perl/varvarname3.html
Look, Perl has a very nice alternative to symbolic references: storing
your data in a hash. It is entirely safe, it is virtually as fast, and
you can even loop over all user supplied variables (try doing THAT using
symbolic references!)
>I'm very sad to see you go on like this Abigail - I expected better
>from you, instead of disparaging me in this manner.
Ooh, I think you've been treated pretty mildly. Using symbolic
references for this kind of purpose is something that is totally beneath
a "senior programmer". In any language. Shame on you. ;-)
--
Bart.
------------------------------
Date: Tue, 30 May 2000 00:38:46 +0200
From: "the dEAthMaKEr" <hoho110@gmx.de>
Subject: File Array
Message-Id: <8gur8m03nc@enews3.newsguy.com>
Hi,
i need to do a file array coz i want to do a small database which searches
in all base.* for entries
so i need something like this:
@FILES = ('blabla/base.*');
foreach $file (@FILES) {
print "File: $file <BR>";
}
cu
dEAthMaKEr
------------------------------
Date: Mon, 29 May 2000 23:58:03 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: HALL OF SHAME :-)
Message-Id: <Pine.GHP.4.21.0005292350210.12313-100000@hpplus01.cern.ch>
On Mon, 29 May 2000, Craig Berry wrote:
> But what about the (more common, here) case of a factually
> incorrect post? If it goes unchallenged,
I know the feeling. Then I recommend that you go back to the original
question, and answer it, clearly.
At some point, you have to trust the other usenauts to make their
own choice. If you offer them your best answer alongside the troll's,
and they prefer the troll's, they have only themselves to
blame.
But if you start arguing with the troll, then everyone gets confused;
time and effort gets wasted, and other perfectly good posts miss the
attention that they could deserve.
> it becomes part of the public
> record, there to mislead countless newbies for all time.
Well, that's usenet. It's part of the price we have to pay for the
relative freedom of expression we get here. I'm afraid we all have to
learn to cope with that, one way or another. Fighting with trolls has
never saved a newsgroup, as far as I am aware.
------------------------------
Date: Mon, 29 May 2000 16:08:26 -0700
From: Kiralynne Schilitubi <callgirl@la.znet.com>
Subject: Re: HALL OF SHAME :-)
Message-Id: <3932F86A.96376196@la.znet.com>
"Alan J. Flavell" wrote:
> On Mon, 29 May 2000, Craig Berry wrote:
(snipped)
> Well, that's usenet. It's part of the price we have to
> pay for the relative freedom of expression we get here.
> I'm afraid we all have to learn to cope with that, one
> way or another. Fighting with trolls has
> never saved a newsgroup, as far as I am aware.
This is all fine and dandy rhetoric, Mr. Flavell,
except for one critical point; you regulars here
are the trolls and harassers.
There exists no legitimate reason for all this
uproar simply because you people personally
disagree with an answer I provided, in good faith,
with good logic and with verifiable factual data,
easily replicated by anyone here.
Why is it so impossible for you people to comment
on articles of others, without resorting to trolling
and vile harassment along with name calling, personal
insults and, at times, vulgarity?
There certainly exists no legitimate reason for
you regulars to constantly troll and harass
people, no reason, no way. You are the trolls.
You are the harassers. This is in more than
abundant evidence, even just from today.
Be sure you are clear on this with honesty.
I am not the only person who registered
concerns about the harassment taking place
within this newsgroup.
You people are are the trolls and harassers.
This notion is in repugnant evidence via your
own words and thoughts, throughout this day,
ironically humorous, a memorable day.
Kira
------------------------------
Date: 29 May 2000 23:19:07 GMT
From: Intergalactic Denizen of Mystery <Tbone@pimpdaddy.com>
Subject: Re: HALL OF SHAME :-)
Message-Id: <8guttb$2icc$1@news.enteract.com>
thoren@southern-division.com writes:
>> I was referring to the "language-independent" aspects of the
>> post. "Feed him till he pukes", "this will kill the community",
>> and "he is a fascist" are examples of what I am talking about.
>
>ah well i understand... bigger words make bigger confidence?
I was talking not about big words, but extreme sentiments.
------------------------------
Date: Tue, 30 May 2000 01:58:59 +0200
From: "Thoren Johne" <thoren@southern-division.com>
Subject: Re: HALL OF SHAME :-)
Message-Id: <8gv0a7$e1l$18$1@news.t-online.com>
Kiralynne Schilitubi <callgirl@la.znet.com> wrote in message
news:3932F86A.96376196@la.znet.com...
> "Alan J. Flavell" wrote:
>
> > On Mon, 29 May 2000, Craig Berry wrote:
>
> (snipped)
>
> > Well, that's usenet. It's part of the price we have to
> > pay for the relative freedom of expression we get here.
> > I'm afraid we all have to learn to cope with that, one
> > way or another. Fighting with trolls has
> > never saved a newsgroup, as far as I am aware.
>
> This is all fine and dandy rhetoric, Mr. Flavell,
> except for one critical point; you regulars here
> are the trolls and harassers.
now honeytroll i tell you a secret: this is the trollgroup and you turn out
to be the only, the real regular. let me expain this to you, i know it's
quite late but damn, don't we have to be there for our people - people like
you?
in germany we have streets that are called 'Autobahn'. each direction has
it's very own line, the lines for each direction are divided so there is no
two-way traffic.
sometimes there are lost souls that come up the autobahn the wrong
direction - which usually is a big mess (don't ask me why, some people by
video games just to live that thrill). for that case we have special
announcements with our radio programm - telling us things like
"Geisterfahrer auf der A9 zwischen München und Nürnberg nahe der Auffahrt
Eching, bitte fahren Sie ganz rechts und überholen Sie nicht"
now imagine that you are listening to your radio and you think: 'damn there
is not just one car in the wrong direction - there are hundreds!
bingo. you are the man!
[rest snipped]
now i beg you to come off that bad trip and be a good citicen, because if
you don't, me and others need to go on in correcting your poor driving
manner here in this group... i personally already have a bad conscience
about that because i wasted bandwith with it.
anyway, fact is i'm german, and so i'm troll and harasser by history. you
can't tell me anything new. i ask you to stop that shit now and forever. if
you don't, the regulars here will make my person liable for all the shit
happen here, i will shot my dog, my horse and my motorcycle in anger, and
you will be hited by a lightning one time in this or another live. if you
don't get hit by lightning my motorcycle-friends will personally slice off
your wings whenever you come to heaven. if you don't come to heaven they
will piss out the hellfire below you - that in fact will make satan himself
pretty angry and he will judge you personaly for that.
stop it NOW! i mean it!
and please please consult your doctor if your medicine is not stron enough.
gruß
thoren
8#X
------------------------------
Date: Tue, 30 May 2000 02:02:53 +0200
From: "Thoren Johne" <thoren@southern-division.com>
Subject: Re: HALL OF SHAME :-)
Message-Id: <8gv0k1$e2b$18$1@news.t-online.com>
Intergalactic Denizen of Mystery <Tbone@pimpdaddy.com> wrote in message
news:8guttb$2icc$1@news.enteract.com...
> thoren@southern-division.com writes:
> >> I was referring to the "language-independent" aspects of the
> >> post. "Feed him till he pukes", "this will kill the community",
> >> and "he is a fascist" are examples of what I am talking about.
> >
> >ah well i understand... bigger words make bigger confidence?
>
> I was talking not about big words, but extreme sentiments.
believe me, they are plain and simple - not a bit of extreme.
gruß
thoren
8#X
------------------------------
Date: 30 May 2000 01:29:00 +0200
From: kaih=7eqUv6oHw-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: HALL OF SHAME :-)
Message-Id: <7eqUv6oHw-B@khms.westfalen.de>
thoren@southern-division.com (Thoren Johne) wrote on 30.05.00 in <8gumas$cg7$18$1@news.t-online.com>:
> i've been reading half a year of THIS trolls post, and i don't like to
> ignore it any more. to ignore THIS troll didn't help a wink, and if it does
> not help to ignore, then i think we should feed him until he pukes his
> little soul out. there are times when it's the most wrong way to simply
> 'ignore' what could kill the community, just because 'ignorance' can't solve
> THIS problem.
Well, there's a simple cure for *your* problem.
*plonk*
Kai
--
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
- Russ Allbery (rra@stanford.edu)
------------------------------
Date: Mon, 29 May 2000 21:50:07 GMT
From: montep@about.com (Monte)
Subject: Re: Help - I've been spammed with PERL
Message-Id: <3932e5d4.9986655@news.hal-pc.org>
On 29 May 2000 15:19:05 -0500, Tony Curtis <tony_curtis32@yahoo.com>
wrote:
>>> On Mon, 29 May 2000 15:43:06 -0400,
>>> "new" <booksellersunion@booksellersunion.org> said:
>> Than, all of a sudden, the page started getting blasted
>> with about a zillion new links -- all sent through
>> AGENT: CGI
>And the relevance to perl is...?
>perl != CGI
>Try in comp.infosystems.www.authoring.cgi
DUH! Tony, can you enlighten all of us as to another program or
language that uses an AGENT::CGI module?
------------------------------
Date: Mon, 29 May 2000 20:15:50 -0400
From: Julian Cook/Sherab Gyatso <president@webticker.com>
To: president@webticker.com, julian.h.cook@usace.army.mil
Subject: Newbie: Pattern Match Question
Message-Id: <39330836.B362CB7C@webticker.com>
Thanks to everyone who gave me help with the
simple backtick question.
My thanks in advance again for help with this one.
It's a pattern matching question of keeping only certain URLs extracted
from a page.
I have successfully managed to track down and create code that extracts
URLs.
Example....
http://fullcoverage.yahoo.com/fc/World/Fiji/
http://www.yahoo.com/dailynews/npr/?http://www.npr.org/ramfiles/news/20000529.news.01.ram
http://dailynews.yahoo.com/h/ap/20000529/pl/clinton_memorial_day_4.html
.......
......
......
In the URLs extracted above, the only one that I need to keep is the one
that has
"2000" in it AND "html". (the third one)
The code looks like this..... (line numbers added for clarity and
discussion)
1 $foundurl=$1; #Found URL
2 $htmlmatch = ($foundurl =~ tr/html//); #Check for string "html"
3 $yearmatch = ($tagline =~ tr/2000//); #Check for "2000" string
4 print "FoundURL equals $foundurl\n";
5 print "HTMLmatch equals $htmlmatch\n";
6 print "Yearmatch equals $yearmatch\n";
This results in this....(question below each)
FoundURL equals http://fullcoverage.yahoo.com/fc/World/Fiji/
HTMLmatch equals 8
Yearmatch equals 0
----
Why would $htmlmatch equal something other zero? "html" doesn't occur
anywhere in the string
FoundURL equals
http://www.yahoo.com/dailynews/npr/?http://www.npr.org/ramfiles/news/20000529.news.01.ram
HTMLmatch equals 12
Yearmatch equals 0
----
Same as above. String "2000" does appear in this URL, yet $yearmatch =
0?
FoundURL equals
http://dailynews.yahoo.com/h/ap/20000529/pl/clinton_memorial_day_4.html
HTMLmatch equals 17
Yearmatch equals 0
------
This is an example of a string that I would like to keep. One that has
an occurance of
both "html" and "2000", yet $yearmatch isn't matching.
Can anyone shed some light on this ?
Many many thanks again.
Julian Cook
president@webticker_dot_com
------------------------------
Date: 30 May 2000 01:03:53 GMT
From: Tina Mueller <tina@streetmail.com>
Subject: Re: Newbie: Pattern Match Question
Message-Id: <8gv41p$22f04$16@fu-berlin.de>
hi,
Julian Cook/Sherab Gyatso <president@webticker.com> wrote:
> I have successfully managed to track down and create code that extracts
> URLs.
> Example....
> http://fullcoverage.yahoo.com/fc/World/Fiji/
> http://www.yahoo.com/dailynews/npr/?http://www.npr.org/ramfiles/news/20000529.news.01.ram
> http://dailynews.yahoo.com/h/ap/20000529/pl/clinton_memorial_day_4.html
> In the URLs extracted above, the only one that I need to keep is the one
> that has
> "2000" in it AND "html". (the third one)
> 1 $foundurl=$1; #Found URL
> 2 $htmlmatch = ($foundurl =~ tr/html//); #Check for string "html"
> 3 $yearmatch = ($tagline =~ tr/2000//); #Check for "2000" string
> 4 print "FoundURL equals $foundurl\n";
> 5 print "HTMLmatch equals $htmlmatch\n";
> 6 print "Yearmatch equals $yearmatch\n";
> This results in this....(question below each)
> FoundURL equals http://fullcoverage.yahoo.com/fc/World/Fiji/
> HTMLmatch equals 8
> Yearmatch equals 0
that's totally right. look at your perl documentation
and see what tr does:
in your case it's replacing anything that equals
h, t, m, l. and i think that's about 8 times.
you want to use m// instead of tr///.
if you really want to replace something, use s///.
and look at
perldoc -f FUNCTION
if you want to use a FUNCTION you don't know.
tina
--
_____ http://www.tinita.de/ ____| _ enter the
| __| |___ ___ _ _ ___
______tina's moviedatabase______| / _` / _ \/ _ \ '_(_-< of
search & add comments or reviews| \__,_\___/\___/_| /__/ perception
------------------------------
Date: 30 May 2000 00:38:40 GMT
From: cheming@lis.pitt.edu (Che-Ming Chang)
Subject: Re: PERL and UDP Source port?
Message-Id: <8gv2ig$q89$1@usenet01.srv.cis.pitt.edu>
Che-Ming Chang (cheming@lis.pitt.edu) wrote:
Never mind the previous UDP port posting. It was the method that I typo with l instead of L. It works now!! :)
: --
: Che-ming Chang [Tom]
: cheming@lis.pitt.edu
: cheming@bellsouth.net
: University of Pittsburgh
--
Che-ming Chang [Tom]
cheming@lis.pitt.edu
cheming@bellsouth.net
University of Pittsburgh
ICQ: 14788508
------------------------------
Date: Mon, 29 May 2000 18:21:48 -0400
From: NagaPutih <s0218327@unix1.cc.ysu.edu>
Subject: Re: Perl CGI Script to generate web site statistics
Message-Id: <Pine.A41.4.20.0005291815570.12426-100000@unix1.cc.ysu.edu>
On Mon, 29 May 2000, Dale Winburn wrote:
> I call the CGI script from the web page with <!--#exec
> cgi="/cgi-bin/cgi01.cgi"-->.
> I have tried a call with a command line input <!--#exec
> cgi="/cgi-bin/cgi01.cgi mypage"--> then use @ARGV, but this gives me an
> error on my host server.
>
> I can find all kinds of single page counters, but all of these use separate
> scripts and count files for each page. I would like to maintain all
> statistics in one file.
here's an idea.
in the page include the following:
<!--#exec cgi="/cgi-bin/cgi01.cgi/mypage"-->
in cgi01.cgi, check value of $ENV{'PATH_INFO'}.
in the example above, $ENV{'PATH_INFO'} contains "/mypage".
------------------------------
Date: 29 May 2000 08:13:46 GMT
From: Tushar Samant <Tbone@pimpdaddy.com>
Subject: Re: Perl unusable as a programming language
Message-Id: <8gt8rq$pc4$1@news.enteract.com>
kaleja@estarcion.com writes:
>Perl does seem to me to have an advantage over some other languages in that
>there's essentially only one implementation of the core language[1] ...
But there are many versions. And although the powers that be are
mostly kind enough to make only syntax errors do something cool in
a new version, there is no saying how undocumented things will change.
BTW, I am curious how a feature is chosen for deprecation. Can it be
any way other than (possibly unfounded) guesses about how infrequently
used it is?
As for "try it out and see"--David Hume had something to say about
this. I am not being facetious. Either you understand the source or
you make guesses at behaviour. The typical programmer I daresay fits
the latter case, and starts with a yes/no question about a *general*
behaviour: e.g. does Perl do sequential evaluation in such-and-such
a case. If it's true, no experimentation is going to prove it. (I
have seen some people deride "cargo cult" coding--an offensive term
as it is--and at the same time promote this "empirical" approach.
Sapienti satis...)
Finally: you might accuse me of being pedantic, and refusing to
accept perfectly reasonable generalizations after trying out a
hundred cases. But this is Perl, and there's simply no "perfectly
reasonable" generalization.
In an earlier thread, we have this "inductive" theory: if BLOCK1,
BLOCK2, ... etc return values none of which are lvalues, then
(do BLOCK1, do BLOCK2, ...) is a list where BLOCK2 is executed
after BLOCK1 etc.
What's the proof, and will you use the theory in production?
------------------------------
Date: 29 May 2000 23:25:09 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Question: Fileupload using cgi-lib.pl
Message-Id: <slrn8j5v2e.j79.efflandt@efflandt.xnet.com>
On 29 May 2000 17:46:49 GMT, Murvin Ming-Wai Lai <mmlai@sfu.ca> wrote:
(snip)
>
>In addition, I know, in cgi.pm, I can do this job for me. HOwever, I have
>problem using cgi.pm --> I can't retrieve anything from param(). That's
>why I try to use cig-lib.pl to do the job for me. Also, I know that in
>cgi.pm, I can use "$tempfile = tmpFileName()" to get the temporary file
>name + path for me. How can I store data using $tempfile? is it a
>handler? ALso, How can I do this in cgi-lib.pl?
I have never used cgi-lib.pl which is now obsolete. But I have used the
CGI module for form creation, processing and file upload without any
problems. 'perldoc CGI' explains how to use it.
Maybe the problem you have with 'CGI.pm' is that it is not 'cgi.pm', but
maybe case doesn't matter on a Windows box.
You might also not have a grasp of object method vs. function method.
The simplest is function method where a simple script like this would
print all the parameters. Uploaded file contents would not be shown here
in scalar context, but the filename would be:
#!/usr/bin/perl
use CGI qw/:standard/;
print header,start_html('Form Test');
if (param) {
print h1("Form Variables"),hr;
# Note: This will even show params that are a list
foreach (param) {$foo = join(', ',param($_)); print "$_ = $foo",br; }
print end_html;
} else {
print h1('Form Test'),hr,start_form,'Your name: ',textfield('name'),
p,'File to upload: ',filefield('upload'),p,submit,end_form,end_html;
}
Note that you should probably pick out the actual filename and strip the
path off of it:
$filename = $1 if $upload =~ m|[/\\:]+([^/\\:]+)$|;
--
David Efflandt efflandt@xnet.com http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://hammer.prohosting.com/~cgi-wiz/ http://cgi-help.virtualave.net/
------------------------------
Date: Mon, 29 May 2000 22:36:17 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: scoping trouble with nested structures
Message-Id: <3932F120.EE89B605@rochester.rr.com>
Mariska wrote:
>
> Hi all.
> Hope someone helps me out of this...
>
> I have a subroutine
> sub routine {
> my $foo="something"
> if ($foo ne "") {
> $foo is not the same anymore
> }
> }
>
> Is there a way to make the scoping recusive?
> or passing params to a 'if block' like subs?
>
> Regards,
> Mariska van Schie
Mariska, $foo is not the same as *what* anymore? The following code
prints:
foo sub routine=something
third foo=another thing
foo after if=something
foo main=nothing
just as it should.
$foo="nothing";
&routine;
print "foo main=$foo\n";
sub routine{
my $foo="something";
if($foo ne ""){
print "foo sub routine=$foo\n";
my $foo="another thing";
print "third foo=$foo\n";
}
print "foo after if=$foo\n";
}
The $foo defined by the first "my" will remain in scope until the
closing bracket of sub routine. The $foo defined by the second "my"
will remain in scope until the closing bracket of the if. The $foo in
package main will be completely unaffected by what goes on in sub
routine (because the first reference to $foo in sub routine is a "my"
definition), and the $foo in tha base block of sub routine is unaffected
by the third $foo defined in the if block. Does that differ from the
behavior you were expecting? If so, read perlsub.
--
Bob Walton
------------------------------
Date: Mon, 29 May 2000 23:07:37 +0100
From: Dave Cross <dave@dave.org.uk>
Subject: Re: Waxing Philosophical
Message-Id: <t9q5js0h7jkfigikb5cds1retbrfcs3el5@4ax.com>
On Mon, 29 May 2000 21:25:47 GMT, "Ben Kennedy"
<bkennedy@hmsonline.com> wrote:
>> This couple orginating this thread very
>> clearly and specifically objected to being
>> harassed within this newsgroup. I object to
>> this constant harassment as well.
>
>ok, now I have no idea what you are talking about - perhaps my news feed is
>behind, but people who ask questions in this group never get bothered, at
>worst they are refered to a perldoc or FAQ. Why don't you quote where they
>got harassed by someone in this newsgroup?
I think I can explain this. brian d foy followed up Godzilla's post
and his message contained the line "stop spreading your ignorance."
The OPs read this as being aimed at them, whereas it was really aimed
at Godzilla. They mentioned this in their next post and a couple of
people pointed out their mistake to them.
So, yes they _did_ object to their treatment, but they were wrong and
Godzilla is wrong. I can't find any evidence of anyone positng
anything derogatory to the orignal posters.
Does that clear things up?
Dave...
--
<http://www.dave.org.uk> SMS: sms@dave.org.uk
yapc::Europe - London, 22 - 24 Sep <http://www.yapc.org/Europe/>
"There ain't half been some clever bastards" - Ian Dury [RIP]
------------------------------
Date: 29 May 2000 22:09:21 GMT
From: Intergalactic Denizen of Mystery <Tbone@pimpdaddy.com>
Subject: Re: Waxing Philosophical
Message-Id: <8gupqh$2e48$1@news.enteract.com>
bkennedy@hmsonline.com writes:
>uh, what are you talking about? the people who posted the initial question
>never got harassed. I think you are misreading some posts. [...]
Your concern is appreciated, but I am sure there is no one who doesn't
understand this already. Your post is counterproductive, because it
"feeds the troll". Peace,
------------------------------
Date: 29 May 2000 23:23:11 GMT
From: Intergalactic Denizen of Mystery <Tbone@pimpdaddy.com>
Subject: Re: Waxing Philosophical
Message-Id: <8guu4v$2il7$1@news.enteract.com>
thoren@southern-division.com writes:
>> That's not a DoS on the "troll", Thoren. That's a DoS on all of *us*.
>> Maybe you don't realize you are only adding to the volume of avoidable
>> posts? Think about it...
>
>the 'ignore the troll' try failed.
Look at the *group* instead of staring at yourself. I agree the
ploy failed to pacify you.
>shall we simply ignore the fact that it failed?
>IMHO this could be called ignorance.
>let's think about another strategy.
Kindly go on with your new strategy. Just don't complain about
whose company it lands you in.
------------------------------
Date: Tue, 30 May 2000 02:05:15 +0200
From: "Thoren Johne" <thoren@southern-division.com>
Subject: Re: Waxing Philosophical
Message-Id: <8gv0k2$e2b$18$2@news.t-online.com>
Intergalactic Denizen of Mystery <Tbone@pimpdaddy.com> wrote in message
news:8guu4v$2il7$1@news.enteract.com...
> thoren@southern-division.com writes:
> >> That's not a DoS on the "troll", Thoren. That's a DoS on all of *us*.
> >> Maybe you don't realize you are only adding to the volume of avoidable
> >> posts? Think about it...
> >
> >the 'ignore the troll' try failed.
>
> Look at the *group* instead of staring at yourself. I agree the
> ploy failed to pacify you.
>
> >shall we simply ignore the fact that it failed?
> >IMHO this could be called ignorance.
> >let's think about another strategy.
>
> Kindly go on with your new strategy. Just don't complain about
> whose company it lands you in.
right now you are the only company i'm landing in... is that a bad sign? ;)
gruß
thoren
8#X
------------------------------
Date: 30 May 2000 01:26:00 +0200
From: kaih=7eqUuraXw-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: Waxing Philosophical
Message-Id: <7eqUuraXw-B@khms.westfalen.de>
aqumsieh@hyperchip.com (Ala Qumsieh) wrote on 29.05.00 in <7aaeh93xkd.fsf@Merlin.i-did-not-set--mail-host-address--so-shoot-me>:
> [I know I'll regret this]
Then don't do it.
Who feeds the troll, gets to take it home.
Kai
--
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
- Russ Allbery (rra@stanford.edu)
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 3201
**************************************