[16426] in Perl-Users-Digest
Perl-Users Digest, Issue: 3838 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 28 21:05:38 2000
Date: Fri, 28 Jul 2000 18:05:14 -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: <964832714-v9-i3838@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 28 Jul 2000 Volume: 9 Number: 3838
Today's topics:
Re: Apology to perl newsgroup <newsposter@cthulhu.demon.nl>
Re: Apology to perl newsgroup <lauren_smith13@hotmail.com>
Re: Apology to perl newsgroup <red_orc@my-deja.com>
Re: Apology to perl newsgroup (BUCK NAKED1)
Re: Apology to perl newsgroup <lr@hpl.hp.com>
Re: Are you looking for hardware or software? <gellyfish@gellyfish.com>
Re: can't use global $^W in "my"... (Abigail)
Re: can't use global $^W in "my"... <bart.lateur@skynet.be>
Re: CGI Perl script on NT for netscape enterprise serve <tony_holzhey@hp.com>
ecologically printed perldocs <bcaligari@shipreg.com>
Re: ecologically printed perldocs (Marcel Grunauer)
Edit Files <psychoNOpsSPAM@pcpatches.com.invalid>
Re: Edit Files <lauren_smith13@hotmail.com>
Re: file extension (Abigail)
Re: File IO (Mark W. Schumann)
Re: File IO <Jonathan.L.Ericson@jpl.nasa.gov>
Re: File IO (Logan Shaw)
Re: Help! <gellyfish@gellyfish.com>
Re: how to remove a file using perl? <gellyfish@gellyfish.com>
Re: I need help <raptor22@tampabay.rr.com>
Is "exit()" really necessary? (BUCK NAKED1)
Re: Is "exit()" really necessary? <DNess@Home.Com>
Re: Is "exit()" really necessary? <lauren_smith13@hotmail.com>
Re: Is "exit()" really necessary? <Jonathan.L.Ericson@jpl.nasa.gov>
Re: NEtBIOS/nbname Part II <gellyfish@gellyfish.com>
Re: parsing a string that is a directory path. <gellyfish@gellyfish.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 28 Jul 2000 22:02:18 GMT
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: Apology to perl newsgroup
Message-Id: <8lsvta$80v$1@internal-news.uu.net>
jtoy <toyboy@toy.eyep.net> wrote:
> If possible, I would like to join this
> newsgroup in hopes of learning and understanding perl and its
> community.
You'll never understand the community ;) Basically the best way
to join this newsgroup is by reading it. You'll be able to learn a
lot. After some time you'll know enough to actually join the
discussions.
> Also, could anyone please tell me what a killfile is?
It's a way to filter out messages. Many newsreading programs
have options to filter out messages from specific people.
You're probably in quite a few people's killfiles already.
They will not see the messages you post.
> And finally, what specific material would you
> recommend for me to read to get a dip into perl? Thanks.
Perl comes with a lot of documentation. It should be already
available on any computer that has perl installed. You can
have a look at www.cpan.org, there is a list of more documents.
Usually you'll be able to find answers to questions you have
in the documentation. I saw a list of good books recently, but I
can't remember where, so my personal recommendation:
Learning Perl
Programming Perl
Erik
------------------------------
Date: Fri, 28 Jul 2000 14:52:46 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: Apology to perl newsgroup
Message-Id: <8lsv9j$1km$1@brokaw.wa.com>
jtoy <toyboy@toy.eyep.net> wrote in message
news:3981FE3A.D2807E3B@toy.eyep.net...
> I recently posted an article callled "help newb Q perl guy just left"
> . The thread got out of hand because of the way I asked my question and
> then after people answered, I talked back rudely. I am sorry for
> causing trouble in here. If possible, I would like to join this
> newsgroup in hopes of learning and understanding perl and its
> community. If I am not welcome, I understand.
Of course it is not up to anyone here whether you stay or not. It is up to
you to conduct yourself in a civil manner.
> Also, could anyone please tell me what
> a killfile is? I heard the name many times in hear, but have never
> heard of it before.
It's a system that filters out selected induhviduals. Unfortunately, since
you were put in so many people's killfiles the last time you came around,
many may not see your apology.
>And finally, what specific material would you
> recommend for me to read to get a dip into perl? Thanks.
Learning Perl by Randal Schwartz. Elements of Programming with Perl by
Andrew Johnson.
See www.perl.com for more info about Perl.
Lauren
print grep ord $_,map{y/a-z//d;$x.="+ $_";chr(eval $x)}
'J74u43-s2tA1-84n33o45th1er5-12-P3e13-82r48l21
H13-a6-76c40k25er2wx8-y6z13-81'=~m#([^!\n]{3})#g#tr/-0-9//d;print
------------------------------
Date: Fri, 28 Jul 2000 21:56:18 GMT
From: Rodney Engdahl <red_orc@my-deja.com>
Subject: Re: Apology to perl newsgroup
Message-Id: <8lsvi0$6pl$1@nnrp1.deja.com>
In article <3981FE3A.D2807E3B@toy.eyep.net>,
toyboy@toy.eyep.net wrote:
> I recently posted an article callled "help newb Q perl guy just left"
> . The thread got out of hand because of the way I asked my question
> and then after people answered, I talked back rudely. I am sorry for
> causing trouble in here. If possible, I would like to join this
> newsgroup in hopes of learning and understanding perl and its
> community. If I am not welcome, I understand. Once again sorry, and
> I won't make any trouble anymore.
good apology. I for one accept it.
> Also, could anyone please tell me what a killfile is?
A killfile enables you to permanently avoid reading posts by certain
people, or from a certain site, or whose Subject: lines contain
particular words
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 28 Jul 2000 16:50:42 -0500 (CDT)
From: dennis100@webtv.net (BUCK NAKED1)
Subject: Re: Apology to perl newsgroup
Message-Id: <665-39820032-90@storefull-246.iap.bryant.webtv.net>
Nothing to do with perl, but...
A "killfile" has to do with posts(or mail) filtering. If someone doesn't
want to read posts from you, they just enter your name into their
"killfile." That way they see every post from a newsgroup, except the
posts from the person(s) that are listed in their "killfile."
Kind regards,
Dennis
------------------------------
Date: Fri, 28 Jul 2000 17:00:53 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Apology to perl newsgroup
Message-Id: <MPG.13ebbe903dc0be1898ac09@nntp.hpl.hp.com>
In article <3981FE3A.D2807E3B@toy.eyep.net> on Fri, 28 Jul 2000 17:42:18
-0400, jtoy <toyboy@toy.eyep.net> says...
> I recently posted an article callled "help newb Q perl guy just left"
> . The thread got out of hand because of the way I asked my question and
> then after people answered, I talked back rudely. I am sorry for
> causing trouble in here. If possible, I would like to join this
> newsgroup in hopes of learning and understanding perl and its
> community. If I am not welcome, I understand. Once again sorry, and I
> won't make any trouble anymore. Also, could anyone please tell me what
> a killfile is? I heard the name many times in hear, but have never
> heard of it before. And finally, what specific material would you
> recommend for me to read to get a dip into perl? Thanks.
Despite the insinuations of some posters, I was sure that you weren't
yet another avatar of our resident troll(s).
Welcome, though how you get out of the many killfiles you already
inhabit I don't know.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 27 Jul 2000 22:02:36 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Are you looking for hardware or software?
Message-Id: <8lq81c$r3n$1@orpheus.gellyfish.com>
On Tue, 25 Jul 2000 22:01:06 +0200 Anton wrote:
>
> If you wish to buy a new hardware or software, would you like to be offered,
> for a whole month, different prices from professional sellers, in order to
> get the best deal possible?. (It's Free).
> Forum21. Free tool for buyers.
>
Wierdly this identical thing was posted on 1 may this year from an
identical host ....
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: 28 Jul 2000 18:17:44 EDT
From: abigail@foad.org (Abigail)
Subject: Re: can't use global $^W in "my"...
Message-Id: <slrn8o41jv.vcg.abigail@alexandra.foad.org>
eaglewing (eaglewing@zensearch.com) wrote on MMDXXIII September MCMXCIII
in <URL:news:8lslm1$57hje$1@ID-41717.news.cis.dfn.de>:
}}
}} "Marcel Grunauer" <marcel@codewerk.com> wrote in message
}} news:slrn8o3jcq.bru.marcel@gandalf.local...
}} > On Fri, 28 Jul 2000 11:03:14 -0700, eaglewing <eaglewing@zensearch.com>
}} wrote:
}} >
}} > >[Thu Jul 27 22:13:06 2000] [error] Can't use global $^W in "my" at
}} > >/home/gavin/codebase/v1/scripts/lucia2 line 1
}} >
}} >
}} > Well, to ask the obvious, you didn't do something like 'my $^W = 1' ?
}} > Because perlvars like $^W, $_ etc. can't be declated as lexicals.
}} >
}} > Just use '$^W = 1' and it'll be ok.
}} >
}} > But that was too obvious..
}}
}}
}} thanks for the mail, but I should have made myself more clear, I haven't
}} used $^W anywhere...heres my code
Indeed, you haven't and the code compiles fine if I try to compile it.
BTW, as you really, really sure that's the same program? After all,
the error is in line 1; and your program starts with the shebang line
on line 1.
Abigail
--
sub f{sprintf'%c%s',$_[0],$_[1]}print f(74,f(117,f(115,f(116,f(32,f(97,
f(110,f(111,f(116,f(104,f(0x65,f(114,f(32,f(80,f(101,f(114,f(0x6c,f(32,
f(0x48,f(97,f(99,f(107,f(101,f(114,f(10,q ff)))))))))))))))))))))))))
------------------------------
Date: Fri, 28 Jul 2000 22:22:22 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: can't use global $^W in "my"...
Message-Id: <va04osglqlfg6vf7lr3b28oum5ruf5bg6p@4ax.com>
eaglewing wrote:
>heres my code
I've tried to compile it, and I get:
Name "bldquery::wrkdb" used only once: possible typo at test.pl line
122.
test.pl syntax OK
Gee... I used to have problems with MacPerl, were a sysntax error put
Perl in an instable state, and I got bogus error messages like yours.
MacPerl normally keeps running, even after the script has finished. What
I needed to do, is quit MacPerl and restart it.
But you seem to be running it on Unix (or similar), so this argument
doesn't count...
--
Bart.
------------------------------
Date: Fri, 28 Jul 2000 16:49:16 -0700
From: "Tony Holzhey" <tony_holzhey@hp.com>
Subject: Re: CGI Perl script on NT for netscape enterprise server
Message-Id: <8lt665$p3h$1@web1.cup.hp.com>
You probably don't have the permissions on the directory set correctly to
run .cgi or .pl files. This is the most common reason for this problem.
Otherwise check the main permissions of the file and the directory.
matt899 wrote in message <0a0ec104.6cb31815@usw-ex0103-018.remarq.com>...
>I'm new to perl and need help! I wrote a simple perl script and
>intended to use it as a CGI.
>
>print "Content-type: text/html\n\n";
>print "<HTML>\n<HEAD>\n<TITLE>hello</TITLE>\n</HEAD>\n";
>print "<BODY>\n";
>print "<p>hello!\n</p>";
>print "</BODY>\n</HTML>";
>
>When I tested it under DOS, it prints...But when used with URL,
>it says:
>
>Not Found
>
>The requested object does not exist on this server. The link you
>followed is either outdated, inaccurate, or the server has
>been instructed not to let you have it.
>
>I know with unix I need to add the header #!/usr/bin/perl but I
>am on NT. Can somebody tell me what's wrong with my code?
>
>thanks!
>
>
>-----------------------------------------------------------
>
>Got questions? Get answers over the phone at Keen.com.
>Up to 100 minutes free!
>http://www.keen.com
>
------------------------------
Date: Sat, 29 Jul 2000 01:47:01 +0200
From: "Brendon Caligari" <bcaligari@shipreg.com>
Subject: ecologically printed perldocs
Message-Id: <8lt5dm$g7o$1@news.news-service.com>
Are there printed perldoc versions available from anywhere?
It's a good thing to have on-line documentation, etc but nothing
beats a good old printout. However, having printed perlfaq
and perlfunc to add to my collection of man pages, craters are
being nuked in my pocket and the ecological cost of all this
printer toner and A4 paper is hitting me.
Also, at cpan, there seem to be ps, html, etc versions of the perl
documentaion. Is there a windows help file version around?
Searched the web but found none.
B
ZCZC
------------------------------
Date: Sat, 29 Jul 2000 00:04:38 GMT
From: marcel@codewerk.com (Marcel Grunauer)
Subject: Re: ecologically printed perldocs
Message-Id: <slrn8o4820.3gf.marcel@gandalf.local>
On Sat, 29 Jul 2000 01:47:01 +0200, Brendon Caligari
<bcaligari@shipreg.com> wrote:
>Are there printed perldoc versions available from anywhere?
>It's a good thing to have on-line documentation, etc but nothing
>beats a good old printout. However, having printed perlfaq
>and perlfunc to add to my collection of man pages, craters are
>being nuked in my pocket and the ecological cost of all this
>printer toner and A4 paper is hitting me.
I'd assume that Programming Perl, 3rd Edition, pretty much covers those
topics. Not in the same words, but you'll have the same information. I
don't know of any 1:1 printed copies being sold.
But for really nice looking copies of the whole documentation - which
may not be what you want, but it's so cool, I'll mention it anyway -
I refer you to a mail Tim Jenness, author of Pod::LaTeX, sent to the
pod-people list:
> V0.51 of my Pod::LaTeX module (pod2latex replacement with Pod::Parser)
> is now on CPAN. This version fixes some oddities with warning messages and
> escapes ^ correctly.
>
> I have managed to generate a 1549 page document from all the pod files
> distributed with perl 5.6.0 without any extra tweaking using:
>
> pod2latex -full -out perlbook -modify /local/perl-5.6/lib/5.6.0/pod
>
> [depending on where you install perl of course]
--
Marcel
sub AUTOLOAD{($_=$AUTOLOAD)=~s;^.*::;;;y;_; ;;print} Just_Another_Perl_Hacker();
------------------------------
Date: Fri, 28 Jul 2000 16:47:18 -0700
From: psycho <psychoNOpsSPAM@pcpatches.com.invalid>
Subject: Edit Files
Message-Id: <02ad84d0.fb367988@usw-ex0105-037.remarq.com>
im having trouble trying to edit files with the contents setup
like $vlaue|$value2|$value3| im have trouble trying to edit or
change of the the values in the file..
EX:
- open file ex.txt
line 1: 2|25|12
line 2: 3|15|10
- edit line 1 and add 1 to 25 to make 26.
i can't seem to get it to edit the line i want to.. can anyone
help?
-----------------------------------------------------------
Got questions? Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com
------------------------------
Date: Fri, 28 Jul 2000 17:11:22 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: Edit Files
Message-Id: <8lt7dg$5n1$1@brokaw.wa.com>
psycho <psychoNOpsSPAM@pcpatches.com.invalid> wrote in message
news:02ad84d0.fb367988@usw-ex0105-037.remarq.com...
> im having trouble trying to edit files with the contents setup
> like $vlaue|$value2|$value3| im have trouble trying to edit or
> change of the the values in the file..
>
> EX:
> - open file ex.txt
> line 1: 2|25|12
> line 2: 3|15|10
>
> - edit line 1 and add 1 to 25 to make 26.
>
> i can't seem to get it to edit the line i want to.. can anyone
> help?
Without code, it is a difficult proposition, indeed.
perlfaq5: How do I change one line in a file/delete a line in a file/insert
a line in the middle of a file/append to the beginning of a file?
See if that solves your problem.
Lauren
--
print grep ord $_,map{y/a-z//d;$x.="+ $_";chr(eval $x)}
'J74u43-s2tA1-84n33o45th1er5-12-P3e13-82r48l21H13-a6-76
c40k25er2wx8-y6z13-81'=~m#([^!\n]{3})#g#tr/-0-9//d;print
------------------------------
Date: 28 Jul 2000 18:18:37 EDT
From: abigail@foad.org (Abigail)
Subject: Re: file extension
Message-Id: <slrn8o41lk.vcg.abigail@alexandra.foad.org>
Daniel van den Oord (danielxx@bart.nl) wrote on MMDXXIII September
MCMXCIII in <URL:news:PYkg5.5088$Gd1.41290@Typhoon.bART.nl>:
,, Is there a way to prevent people to use .\..\.\..\ or something like that
,, ????
You could pry out the appropriate keys on their keyboards.
Abigail
--
perl -we'$;=$";$;{Just=>another=>Perl=>Hacker=>}=$/;print%;'
------------------------------
Date: 28 Jul 2000 18:50:57 -0400
From: catfood@apk.net (Mark W. Schumann)
Subject: Re: File IO
Message-Id: <8lt2oh$bmm@junior.apk.net>
In article <39818182.BED9B933@gte.net>,
Keith Underwood <keithu@gte.net> wrote:
>We use a Job Control System that has 'File Events'. Meaning that I can
>tell the JCS to monitor a directory for an incoming file. When it
>detects a file, the JCS kicks off a process that does whatever we need
>to the file. The problem is, I don't want to start processing on the
>file until the file is completely been written to. Some of these files
>are 100-200mg, and the JCS will detect them once they start to arrive.
>Does Perl have a module or function that will check to see if the file
>is still being written to, and if so then sleep and check again, and
>again until the file is complete, and then the JCS can start the
>processing on the file. I can do this in Unix with Korn Shell but I
>need to do it in NT.
I have done something like this, but only through a couple of
heurestics that have been "good enough" to work okay in production.
1. Check file size every $n seconds until the size stops changing.
Assume the writing process(es) must be done. Not totally
foolproof.
2. Execute (maybe via backticks) the "fuser" command to see which
processes if any have the file open. Subject to race conditions,
maybe not available on NT, doesn't know about NFS TTBOMK.
If someone has a better solution I'd love to hear it. I wonder whether
stat() does what you need. I should have checked that when I had the
same question about two years ago, and I'm just thinking of it now.
------------------------------
Date: Fri, 28 Jul 2000 15:30:22 -0700
From: Jon Ericson <Jonathan.L.Ericson@jpl.nasa.gov>
Subject: Re: File IO
Message-Id: <3982097E.49AEF090@jpl.nasa.gov>
Keith Underwood wrote:
> We use a Job Control System that has 'File Events'. Meaning that I can
> tell the JCS to monitor a directory for an incoming file. When it
> detects a file, the JCS kicks off a process that does whatever we need
> to the file. The problem is, I don't want to start processing on the
> file until the file is completely been written to. Some of these files
> are 100-200mg, and the JCS will detect them once they start to arrive.
> Does Perl have a module or function that will check to see if the file
> is still being written to, and if so then sleep and check again, and
> again until the file is complete, and then the JCS can start the
> processing on the file. I can do this in Unix with Korn Shell but I
> need to do it in NT.
I would explore:
a) file locking (might not be an option for you)
b) 'perldoc -f -s' (is this how you do with sh?)
c) NT's file permission scheme
in that order.
Jon
--
Knowledge is that which remains when what is
learned is forgotten. - Mr. King
------------------------------
Date: 28 Jul 2000 18:40:25 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: File IO
Message-Id: <8lt5l9$t2o$1@provolone.cs.utexas.edu>
In article <8lt2oh$bmm@junior.apk.net>,
Mark W. Schumann <catfood@apk.net> wrote:
>In article <39818182.BED9B933@gte.net>,
>Keith Underwood <keithu@gte.net> wrote:
>>We use a Job Control System that has 'File Events'. Meaning that I can
>>tell the JCS to monitor a directory for an incoming file. When it
>>detects a file, the JCS kicks off a process that does whatever we need
>>to the file. The problem is, I don't want to start processing on the
>>file until the file is completely been written to.
>
>I have done something like this, but only through a couple of
>heurestics that have been "good enough" to work okay in production.
>
>1. Check file size every $n seconds until the size stops changing.
:
:
>2. Execute (maybe via backticks) the "fuser" command to see which
:
:
>If someone has a better solution I'd love to hear it. I wonder whether
>stat() does what you need. I should have checked that when I had the
>same question about two years ago, and I'm just thinking of it now.
Here's my solution's pseudo-code for the writer:
open file "foo00012".
write write write write.
write some more.
ok, done writing? yeah, done writing.
close file "foo00012".
rename file "foo00012" to "foo00012.done".
process next file or something.
and pseudo-code for the reader:
look at directory.
process any file named something like /[.]done$/.
ignore all others.
There is a variation in which the writer does this:
open file "in-progress/foo00012".
write write write write.
yeah yeah yeah, more writing to do, so do it.
ok, done writing and stuff.
close file "in-progress/foo00012".
rename file "in-progress/foo00012" to "written/foo00012".
and the reader does this:
look at directory "written/".
process any/all files you find there.
move them to a directory "processing/" while working on them
if you want (so you can have more than one reader).
Of course, this all assumes that whatever process you have which is
writing to the files can rename them too. But that shouldn't be too
terrible in most cases. You can even do it with ftp.
If you can't do that, then a better heuristic is to do a stat() on the
file and check the mtime, then only do something with it if mtime is
more than some number of seconds in the past (like 300 maybe).
Hope that helps.
- Logan
------------------------------
Date: 27 Jul 2000 21:55:22 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Help!
Message-Id: <8lq7jq$r31$1@orpheus.gellyfish.com>
On Wed, 26 Jul 2000 16:54:03 GMT Simon wrote:
> Thanks for the pointers Tom!
>
> I searched the web for hours today, looking for a script that would help me
> achieve my goals, after that I looked for tutorials! Now I thought I would
> check out some news groups and see if anyone could help me, I'm not a
> developer so I tend to struggle a bit with Perl.
>
> Have you used this module before? I need to have an HTML form with the
> following tag <INPUT TYPE="file" NAME="attachment"> then have this module or
> one similar take the file and attach it to an e-mail!
>
> do you have any idea how to write teh perl to accomplish this?
>
Search Deja News as I have posted programs that do this before. All use
Mime::Lite and all use CGI.pm .
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: 27 Jul 2000 21:50:50 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: how to remove a file using perl?
Message-Id: <8lq7ba$r2j$1@orpheus.gellyfish.com>
On Wed, 26 Jul 2000 19:18:00 GMT Aart Jan van der Linden wrote:
> What would be the syntax to remove a file (filename is in the variable
> $FORM{titel} ) from a folder on my server? (I have full rights to
> remove files from this folder)
perldoc -f unlink
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Fri, 28 Jul 2000 23:51:27 GMT
From: "Felrodian" <raptor22@tampabay.rr.com>
Subject: Re: I need help
Message-Id: <30pg5.10559$sO2.46864@typhoon.tampabay.rr.com>
In article <39821AC6.B635E02C@ica.net>, nikita <nikitta@ica.net> wrote:
> Hi everybody
>
> I going mad with this script Can anybody please help me the script
> should have given me 10 lines of information with the "Next" button but
> it gives me a sub "Error" instead. I know there is a mistake somewhere i
> could find it.
>
> Thanks in advance
>
Here's a hint: Use a subject that shows what your problem is, people are much more
likely to read it that way, and once is enough. Be patient, sending it many times only
gets quicker flames, not quicker help.
------------------------------
Date: Fri, 28 Jul 2000 17:17:48 -0500 (CDT)
From: dennis100@webtv.net (BUCK NAKED1)
Subject: Is "exit()" really necessary?
Message-Id: <668-3982068C-9@storefull-246.iap.bryant.webtv.net>
I have a buddy in another ng who seems to know Perl a little better than
myself?; but I question his knowledge because his Perl scripts seem to
be "down and dirty" and he never uses "use strict;".
At the end of every Perl script he writes, he puts an "exit;"... and
insists that I should do the same (even on my counter script). I
questioned him about it, and he says exit() stops any program, and
should be put at the end of all perl scripts.
mmm.... okay. I can see where using "exit()" for subroutines would be
useful, but I can't really see the need to do this just because you are
at the bottom of the script you are writing. Doesn't the script
terminate automatically when it reaches the end of the script file?
Though the perl docs do say that the "exit()" function terminates a
script, my understanding of using the "exit()" function differs from my
buddy's. The perl docs appear to state that "exit()" is used only for
expressions, thus the perl doc term "exit EXPR".
Further, I thought the perl faq state that "exit" is similar to "die"
but that it also acts upon a preceding "END" and is mostly used for
subroutines. I'm not real clear on that part though.
So, I don't think that exit() is needed at the end of every Perl script
written. Who is correct?
Regards,
Dennis
PS Thanks to all for the extra tips on the other here-doc printing,
truncating, etc.
------------------------------
Date: Fri, 28 Jul 2000 23:02:14 GMT
From: David Ness <DNess@Home.Com>
Subject: Re: Is "exit()" really necessary?
Message-Id: <39821103.C4339041@Home.Com>
BUCK NAKED1 wrote:
>
> I have a buddy in another ng who seems to know Perl a little better than
> myself?; but I question his knowledge because his Perl scripts seem to
> be "down and dirty" and he never uses "use strict;".
>
> At the end of every Perl script he writes, he puts an "exit;"... and
> insists that I should do the same (even on my counter script). I
> questioned him about it, and he says exit() stops any program, and
> should be put at the end of all perl scripts.
>
> mmm.... okay. I can see where using "exit()" for subroutines would be
> useful, but I can't really see the need to do this just because you are
> at the bottom of the script you are writing. Doesn't the script
> terminate automatically when it reaches the end of the script file?
>
> Though the perl docs do say that the "exit()" function terminates a
> script, my understanding of using the "exit()" function differs from my
> buddy's. The perl docs appear to state that "exit()" is used only for
> expressions, thus the perl doc term "exit EXPR".
>
> Further, I thought the perl faq state that "exit" is similar to "die"
> but that it also acts upon a preceding "END" and is mostly used for
> subroutines. I'm not real clear on that part though.
>
> So, I don't think that exit() is needed at the end of every Perl script
> written. Who is correct?
>
> Regards,
> Dennis
>
> PS Thanks to all for the extra tips on the other here-doc printing,
> truncating, etc.
IMO
perldoc -f exit
is pretty clear on the subject
------------------------------
Date: Fri, 28 Jul 2000 16:13:34 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: Is "exit()" really necessary?
Message-Id: <8lt413$40l$1@brokaw.wa.com>
BUCK NAKED1 <dennis100@webtv.net> wrote in message
news:668-3982068C-9@storefull-246.iap.bryant.webtv.net...
> I have a buddy in another ng who seems to know Perl a little better than
> myself?; but I question his knowledge because his Perl scripts seem to
> be "down and dirty" and he never uses "use strict;".
>
> At the end of every Perl script he writes, he puts an "exit;"... and
> insists that I should do the same (even on my counter script). I
> questioned him about it, and he says exit() stops any program, and
> should be put at the end of all perl scripts.
>
> mmm.... okay. I can see where using "exit()" for subroutines would be
> useful, but I can't really see the need to do this just because you are
> at the bottom of the script you are writing. Doesn't the script
> terminate automatically when it reaches the end of the script file?
>
> Though the perl docs do say that the "exit()" function terminates a
> script, my understanding of using the "exit()" function differs from my
> buddy's. The perl docs appear to state that "exit()" is used only for
> expressions, thus the perl doc term "exit EXPR".
>
> Further, I thought the perl faq state that "exit" is similar to "die"
> but that it also acts upon a preceding "END" and is mostly used for
> subroutines. I'm not real clear on that part though.
>
> So, I don't think that exit() is needed at the end of every Perl script
> written. Who is correct?
What do you want to do? These are guidelines I use in my programs.
Do you want to:
1) Exit the program immediately : yes, use exit() or die() (the latter being
preferable for reasons explained in the docs)
2) Execute some EXIT code which may or may not actually exit : no, just make
that code a function and exit() from inside the function.
3) Exit at the end of the script : no, why use exit() when the program will
terminate anyway?
These may work for you, the may not, but they are what I follow. I almost
never find exit() preferable to die(), though.
Lauren
--
print grep ord $_,map{y/a-z//d;$x.="+ $_";chr(eval $x)}
'J74u43-s2tA1-84n33o45th1er5-12-P3e13-82r48l21H13-a6-76
c40k25er2wx8-y6z13-81'=~m#([^!\n]{3})#g#tr/-0-9//d;print
------------------------------
Date: Fri, 28 Jul 2000 16:11:17 -0700
From: Jon Ericson <Jonathan.L.Ericson@jpl.nasa.gov>
Subject: Re: Is "exit()" really necessary?
Message-Id: <39821315.956E59ED@jpl.nasa.gov>
BUCK NAKED1 wrote:
> I have a buddy in another ng who seems to know Perl a little better than
> myself?; but I question his knowledge because his Perl scripts seem to
> be "down and dirty" and he never uses "use strict;".
>
> At the end of every Perl script he writes, he puts an "exit;"... and
> insists that I should do the same (even on my counter script). I
> questioned him about it, and he says exit() stops any program, and
> should be put at the end of all perl scripts.
I always 'use strict;' but I rarely use 'exit' (and never 'exit()').
Every now and then perl corrects my typos. My scripts always stop
executing when they have no more commands to execute. I don't listen to
people who tell me what to do, but can't tell me why. I am content with
life.
Jon
--
Knowledge is that which remains when what is
learned is forgotten. - Mr. King
------------------------------
Date: 27 Jul 2000 21:49:52 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: NEtBIOS/nbname Part II
Message-Id: <8lq79g$r26$1@orpheus.gellyfish.com>
On Wed, 26 Jul 2000 14:28:21 -0400 Terrill_b wrote:
> Topic: How does Steve Gibson (and others like Anonymizer.com) get YOUR
> computers name? Would like the answer in Perl...
>
But the answer might not *be* in Perl.
> Seems I started a few "My computer's better than your computer" type wars.
> Flame not required.
>
> Ok, HTTP_REFERER, if present (Norton Internet Security trashes it) can in
> fact tell me the name of your ISP, maybe. Other things can also trash
> REFERER.
>
HTTP_REFERER (might) be the page that you followed a link from to get to
the current page but it will (almost certainly) never give any information
about the machine that has made the request. You might be thinking of some
other environment variable that is passed as part of the CGI perhaps.
> gethostbySOMETHING will return your IP address or (again) your ISP name, for
> example gethostbyname on my IP returns ecr.paste.net no matter which
> computer I'm using (Linux or Windoze).
>
Er, this machine might be 'jns.dircon.co.uk','desk223.ch.dircon.net',
'orpheus.gellyfish.com' or 'host5-99-49-253.btinternet.com' in the period
of a single day - I'm not quite sure what the point is here.
> But Gibson (no not ON grc.com, but yes, in his Shield's Up) returns my name.
> In my case, it returns "Valued Viao Customer" from one of my Windoze
> laptops, and "Effulgent" from my Linux box.
>
If you have Samba running on the Linux machine and Windows Networking on
the other then, yes, it might well be by some NetBIOS name query . If you
dont then I would simply invoke smoke and mirrors. The NetBIOS naming
service uses port 137 you can use IO::Socket to connect to it, what you
might send to the socket however you will need to discover from the
pertinent specification or RFC or possibly the source code of nmblookup.
If you cant be arsed to do that I would suggest that you either give up
this exercise completely or use nmblookup (or its moral equivalent on
whatever platform you might be using) :
[root@orpheus gellyfish]# nmblookup -A 127.0.0.1
Sending queries to 127.255.255.255
Looking up status of 127.0.0.1
received 5 names
ORPHEUS <00> - B <ACTIVE>
ORPHEUS <03> - B <ACTIVE>
ORPHEUS <20> - B <ACTIVE>
OFFICE <00> - <GROUP> B <ACTIVE>
OFFICE <1e> - <GROUP> B <ACTIVE>
num_good_sends=0 num_good_receives=0
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: 27 Jul 2000 20:52:59 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: parsing a string that is a directory path.
Message-Id: <8lq3ur$qpg$1@orpheus.gellyfish.com>
On Wed, 26 Jul 2000 10:39:11 -0700 Joe Schmoe wrote:
> I have a CGI scripts that is suppose to list the content of a
> directory on the local computer. That's easy, it's something even I
> can do.
>
> But I also have to create a "up" button to get the web page to display
> the contents of the directory one step above. For example, if the CGI
> is displaying the contents of
> "/home/john/notes/class1"
> It also needs to display a link capable of go showing
> "/home/john/notes"
>
> I'm looking for a way to take the string
>
> "/home/john/notes/class1"
>
> and be able to change it to
>
> "/home/johm/notes/class1"
>
I assume you mean '/home/john/notes';
> So it looks for the last slash "/" and remove it and everything after
> it. I think regexp may be the way to go, but I don't know how to go
> about it.
>
> Or maybe there are better methods, any help is greatly appreciated.
File::Basename might help here. Or possibly even a good read of the perlre
man page.
$path = '/home/john/notes/class1';
$path =~ s#(.*)/[^/]*#$1#;
The look at perlre again.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
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 3838
**************************************