[16505] in Perl-Users-Digest
Perl-Users Digest, Issue: 3917 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 4 18:05:40 2000
Date: Fri, 4 Aug 2000 15:05:21 -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: <965426720-v9-i3917@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 4 Aug 2000 Volume: 9 Number: 3917
Today's topics:
Re: bug in localtime()??? <flavell@mail.cern.ch>
Re: bug in localtime()??? (Mark-Jason Dominus)
Re: bug in localtime()??? <kent@darwin.eeb.uconn.edu>
Re: bug in localtime()??? <tim@ipac.caltech.edu>
Re: bug in localtime()??? <callgirl@la.znet.com>
Re: CGI.pm not passing ampersands properly <rschram@reed.edu>
Re: CGI.pm not passing ampersands properly <ewald@electronicfrontiers.com>
Changes to remote web site content .. <seano@teleport.com>
Re: Changes to remote web site content .. <rwoodman@verio.net>
Re: Changes to remote web site content .. <kjetilskotheim@iname.com>
Cookie on the server side <bestwebmoney@themail.com>
DBI/Oracle: Retrieving lowercase field names from Oracl <pobbard@hotresponse.com>
Re: execute a Perl script in another Perlscript <my@email.adr>
Re: execute a Perl script in another Perlscript <bean@agentkhaki.com>
Re: execute a Perl script in another Perlscript <care227@attglobal.net>
Re: execute a Perl script in another Perlscript <bean@agentkhaki.com>
Re: execute a Perl script in another Perlscript <flavell@mail.cern.ch>
Re: execute a Perl script in another Perlscript <DNess@Home.Com>
Re: Gee, thanks for all the help :-( (Abigail)
Re: Gee, thanks for all the help :-( (NP)
Re: Gee, thanks for all the help :-( <aqumsieh@hyperchip.com>
Re: Gee, thanks for all the help :-( <russ_jones@rac.ray.com>
Re: Gee, thanks for all the help :-( <keithmur@mindspring.com>
Re: get files from other servers (Abigail)
Getting program name - how? <edge@gecko.org>
Re: Getting program name - how? <tony_curtis32@yahoo.com>
Re: Getting program name - how? <edge@gecko.org>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 4 Aug 2000 20:27:47 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: bug in localtime()???
Message-Id: <Pine.GHP.4.21.0008042013550.13101-100000@hpplus03.cern.ch>
On Fri, 4 Aug 2000, Mike King @work hung upside-down from a
convenient nntp-server and yelled at us all:
> Why does everyone in this group assume the person asking the question
> hasn't read the docs?
Well, _you_ haven't. Usenet new users are expected to learn how
to quote, before trying to lecture other folks.
> I HAVE read the docs,
All the evidence is against you.
> and it does not detail why I
> am being returned the wrong value for month localtime()[4].
I don't believe you. It returns the right (i.e the documented) value
for everyone else. Some of them didn't read the documentation and
thought that it was wrong, but that's what you get when you don't pay
attention to the documentation.
> Maybe I am missing something in the docs,
Maybe you haven't got a proper Perl installation, the one where it
emphasises:
In particular this means that $mon has the range 0..11 and
$wday has the range 0..6 with sunday as day 0
and so on.
Anyone who really _had_ consulted the docs and was still confused
would be well advised to cite the document they had consulted, quote
the text they are having trouble with, and then ask their question.
We've all, repeatedly, seen the old "I've read all the documents,
books and FAQs" routine from people who clearly couldn't script their
way out of a paper bag. It's only natural to assume they haven't
really, unless and until they actually _show_ the group what it is
they were having trouble with. I mean, as long as they're literate
enough to post to usenet, they're expected to actually read the stuff,
not just to stick it under the pillow and hope for osmosis.
------------------------------
Date: Fri, 04 Aug 2000 18:52:43 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Re: bug in localtime()???
Message-Id: <398b10fb.ddb$21b@news.op.net>
In article <398AF61E.2882C570@worldwebserver.com>,
Mike King @work <mikek@worldwebserver.com> wrote:
>
>
>Tony Curtis wrote:
>>
>> $ perldoc -f localtime
>>
>> and $mon is the month itself, in the range `0..11'
>> with 0 indicating January and 11 indicating
>> December. $year is the number of years since
>> 1900. That is, $year is `123' in year 2023.
>
>perldoc perlfunc does not detail that (at least on my system).
It's new in Perl 5.6. I was afraid that the previous explanation
In particular this means that $mon has the range 0..11
and $wday has the range 0..6 with sunday as day 0.
wouldn't be clear enough, so I made it more explicit.
------------------------------
Date: 04 Aug 2000 14:37:05 -0400
From: Kent Holsinger <kent@darwin.eeb.uconn.edu>
Subject: Re: bug in localtime()???
Message-Id: <m0em44ub3i.fsf@darwin.eeb.uconn.edu>
>>>>> "Mike" == Mike King @work <mikek@worldwebserver.com> writes:
Mike> Tony Curtis wrote:
>> $ perldoc -f localtime
>>
>> and $mon is the month itself, in the range `0..11' with 0
>> indicating January and 11 indicating December. $year is the
>> number of years since 1900. That is, $year is `123' in year
>> 2023.
Mike> perldoc perlfunc does not detail that (at least on my
Mike> system).
I get the paragraph Tony reported with either
perldoc perlfunc
or
perldoc -f locaaltime.
Perl v5.005_03 (no I haven't upgraded yet), ActivePerl Build 522,
under NT v4.0. Your Perl installation appears to be incomplete.
Kent
--
Kent E. Holsinger kent@darwin.eeb.uconn.edu
http://darwin.eeb.uconn.edu
-- Department of Ecology & Evolutionary Biology
-- University of Connecticut, U-3043
-- Storrs, CT 06269-3043
------------------------------
Date: Fri, 04 Aug 2000 12:51:57 -0700
From: Tim Conrow <tim@ipac.caltech.edu>
Subject: Re: bug in localtime()???
Message-Id: <398B1EDD.613D1227@ipac.caltech.edu>
"Mike King @work" wrote:
>
> Greg Bacon wrote:
> >
> > Go back and reread the documentation on localtime in the perlfunc
> > manpage. You'll find that there is no bug.
>
> Nope didn't help.
>
> perldoc perlfunc
>
> found the localtime entry. According to the doc, localtime()[4] returns
> the numeric month. August is 8. I am being returned 7. Why?
>
> -Mike K.
Try reading more carefully:
"$mday is the day of the month, and $mon is the month
itself, in the range C<0..11> with 0 indicating January and 11
indicating December."
--
-- Tim Conrow tim@ipac.caltech.edu 626-395-8435
------------------------------
Date: Fri, 04 Aug 2000 12:54:11 -0700
From: "Godzilla!" <callgirl@la.znet.com>
Subject: Re: bug in localtime()???
Message-Id: <398B1F63.437C97E1@la.znet.com>
Mark-Jason Dominus wrote:
> Mike King wrote:
> > Tony Curtis wrote
> >> $ perldoc -f localtime
> >> and $mon is the month itself, in the range `0..11'
> >> with 0 indicating January and 11 indicating
> >> December. $year is the number of years since
> >> 1900. That is, $year is `123' in year 2023.
> > perldoc perlfunc does not detail that (at least on my system).
> It's new in Perl 5.6. I was afraid that the previous explanation
> In particular this means that $mon has the range 0..11
> and $wday has the range 0..6 with sunday as day 0.
> wouldn't be clear enough, so I made it more explicit.
* smiles *
All this mule manure screaming, yelling and hatred
by other experienced programmers and, not a single
one has enough common sense to check his facts
before shooting off his big mouth.
"Values for months returned from the localtime function
will range from zero to eleven, inclusive. This means
a value for January will be zero, a value for December
will be eleven. If you need correct values for a month
number, this is, one to twelve, January as one and
December as twelve, add one to your month return value
within your program time routine."
You boys need a professional ghost writer and lick of sense.
Godzilla!
--
Eight Miles High, I will rock you.
http://la.znet.com/~callgirl5/8mile.mid
------------------------------
Date: Fri, 04 Aug 2000 13:18:13 -0700
From: RS@ <rschram@reed.edu>
Subject: Re: CGI.pm not passing ampersands properly
Message-Id: <17234969.a1e6a2f8@usw-ex0102-014.remarq.com>
vek@pharmnl.ohout.pharmapartners.nl (Villy Kruse) wrote:
>It can be risky to try to handle parameters you haven't
>designed into the
>form. The enemy might have used a modified form to create
>unexpected
>parameter names with evil intent.
Hi, I am also new to Perl/CGI programming. I recently created a
script that dynamically generates a HTML form which contains one
text field per column in a mysql table. When the user submits
the form ( to add a new record to the database ), I use a
similar method of assigning param-name/param-value to a
key/value pair in a hash, then munching on the hash to make it
acceptable to SQL syntax.
I thought it very clever of me to do it this way rather than
have the script presume what columns it would be updating. This
way, the script can be applied to many kinds of mysql tables
with few to no modifications to the code.
Now I read the above. I never thought about "modified forms"
or "evil intent." Could you say more on the subject?
-----------------------------------------------------------
Got questions? Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com
------------------------------
Date: Fri, 4 Aug 2000 17:38:56 -0400
From: CertifiChecks <ewald@electronicfrontiers.com>
Subject: Re: CGI.pm not passing ampersands properly
Message-Id: <MPG.13f501fe3a26b739989682@news.mtcibs.com>
In article <8meiid$lrc$1@triox.mtcibs.com>,
ewald@electronicfrontiers.com says...
> I am using CGI.pm in a Perl script. When a form field is submitted with an
> ampersand in it, everything after the ampersand is being dropped. I have
> read the CGI documentation and could not find anything specific to
> ampersands in form fields. After searching the news groups, the messages I
> found say that CGI.pm should take care of embedding the &s. Here is the
> code I am using:
>
<snip>
I have found my problem. Nothing is wrong with param, it was working as
expected.
We have a shopping cart system which runs on top of our web site and
parses everything that is submitted to the server unless told otherwise.
When the form was submitted, before it got to my script, the cart system
was turning the encoded ampersands into regular ampersands. CGI.pm was
then correctly seeing them as separate form fields.
My apologies to the group!!
-Ed
------------------------------
Date: Fri, 04 Aug 2000 12:09:24 -0700
From: Sean O'Halloran <seano@teleport.com>
Subject: Changes to remote web site content ..
Message-Id: <398B14E4.86E5471@teleport.com>
Hi -
I was wondering if anyone out there has run across, or has a copy of a
perl script that would periodically check a web site (remote site - not
under my control) for changes in it's content .. HTML - graphics, etc.
I have competent perl skills, and I could tailor a script for my needs
pretty easily. I was wondering if anyone had any suggestions /
recommendations / pointers for anything like this, or a suitable
template from which to base something like this on ...
Thanks in advance -
Seano
------------------------------
Date: Fri, 04 Aug 2000 14:40:55 -0500
From: Randall Woodman <rwoodman@verio.net>
Subject: Re: Changes to remote web site content ..
Message-Id: <398B1C46.73AEEB2@verio.net>
Sean O'Halloran wrote:
> Hi -
>
> I was wondering if anyone out there has run across, or has a copy of a
> perl script that would periodically check a web site (remote site - not
> under my control) for changes in it's content .. HTML - graphics, etc.
>
> I have competent perl skills, and I could tailor a script for my needs
> pretty easily. I was wondering if anyone had any suggestions /
> recommendations / pointers for anything like this, or a suitable
> template from which to base something like this on ...
>
> Thanks in advance -
>
> Seano
Umm, use your browser? :-)
Let's assume that the page you want is a static page. Given that, it would
be easy to copy the page to your own system. Then on a periodic basis, you
grap the file again and compare it to your 'baseline". (You could easily
use diff for this.)
Not a super perl solution but it would work and would not be that difficult
to implement.
------------------------------
Date: Fri, 04 Aug 2000 21:51:47 +0200
From: Kjetil Skotheim <kjetilskotheim@iname.com>
To: Sean O'Halloran <seano@teleport.com>
Subject: Re: Changes to remote web site content ..
Message-Id: <398B2CE3.EEF6468F@iname.com>
Try something like this:
(requires unix with the sendmail program, do "which sendmail"
to check its location and change this acordingly in the following
script)
#!/usr/bin/perl
use LWP::Simple;
$site=shift;
$checksum_file="checksum"; #maybe use full pathname here?
$mail="myself@asdf.com";
$new_checksum=unpack("%16C*", get($site));
$old_checksum=`cat $checksum_file`;
if($new_checksum != $old_checksum and -f "checksum"){
open(MAIL,'|/usr/bin/sendmail -t');
print MAIL "To: $myself\nFrom: $myself\nSubject: Change detected in
$site\n\nChange detected on $site\n\n";
close(MAIL);
}
open(F,">$checksum_file");print F $checksum_new;close(F);
exit;
Put this script into say detect.pl, do chmod a+x detect.pl
and add this line into your crontab: (crontab -e in linux)
6 0 * * * /wherever/you/put/it/detect.pl
http://whatever.site.to.check.com/
...to run detection every morning at 6 a.m.
..change 6 to * to check every hour on the hour.
Sean O'Halloran wrote:
>
> Hi -
>
> I was wondering if anyone out there has run across, or has a copy of a
> perl script that would periodically check a web site (remote site - not
> under my control) for changes in it's content .. HTML - graphics, etc.
>
> I have competent perl skills, and I could tailor a script for my needs
> pretty easily. I was wondering if anyone had any suggestions /
> recommendations / pointers for anything like this, or a suitable
> template from which to base something like this on ...
>
> Thanks in advance -
>
> Seano
--
Kjetil Skotheim
kjetilskotheim@iname.com
------------------------------
Date: Fri, 4 Aug 2000 23:37:21 +0200
From: "Ed" <bestwebmoney@themail.com>
Subject: Cookie on the server side
Message-Id: <uoXz2xl$$GA.230@net025s>
I am looking for a tutorial on how to write and use the cookies on the
server side (login retrieve and add info etc) or a script that does this so
I can learn it by examining the data(I have looked at cgi-resources but
couldn't find it)
Edwin
------------------------------
Date: Fri, 4 Aug 2000 16:06:08 -0400
From: "Philip P. Obbard" <pobbard@hotresponse.com>
Subject: DBI/Oracle: Retrieving lowercase field names from Oracle using fetchrow_hashref
Message-Id: <zhFi5.27179$GS1.638842@news-west.usenetserver.com>
Hi all,
I'm using the DBI package to access Ooracle and pull out a large amount of
information using the fetchrow_hashref method. Oracle's default is to
return all the column names (keys for the hashref) as uppercase, but
ultimately I need them lowercase and would like to be able to do this
without having to traverse the whole hash after I've retreived it.
Is there any parameter I can set when first making the DBI connection to
Oracle that would change this default? Or is there something I can set on a
case by case basis in Oracle that would acheive the same end?
I could potentially use a method other than fetchrow_hashref but it would
require a lot more work and make the program in question much more difficult
to maintain.
Thanks,
Philip
--
--------------
Hotresponse - www.hotresponse.com
W: (646) 375-7845
pobbard@hotresponse.com
------------------------------
Date: Fri, 04 Aug 2000 14:45:53 -0400
From: AvastYeMatey <my@email.adr>
Subject: Re: execute a Perl script in another Perlscript
Message-Id: <398B0F60.8ACD6E46@email.adr>
AvastYeMatey wrote:
> nobull@mail.com wrote:
>
> > "Timothy H. Schilbach" <tschilbach@aodinc.com> writes upside down:
> >
> > > <johands@hotmail.com> wrote in message news:8m4uiq$kc0$1@nnrp1.deja.com...
> >
> > > > how do i execute an cgi-script(written in Perl) within another cgi-
> > > > script (written in Perl).
> > > >
> > > > So i have a cgi-script and then somewhere in this cgi-script i want
> > > > another cgi-script to be executed.
> >
> > > This is an excellent question. If you find out please clue me in :-)
> >
> > No it's not! It's a damn awfull question. Not least because there
> > are actully two completely different questions the OP could actually be
> > asking. But don't take my word for it - go to deja.com (or your
> > favourate Usenet search engine) and see the answers given the last 100
> > or so times this exact question was asked.
>
> Holy Moly! Temper, temper there Mr. Schilbach. If he says he feels it's an
> excellent question let him have his feeling. There's no reason for the
> nastiness.
Meant to chide Mr. NoBull, NOT Mr. Schilbach. Sorry about that Mr. Schilbach.
Avast
------------------------------
Date: 04 Aug 2000 15:17:05 EDT
From: bean <bean@agentkhaki.com>
Subject: Re: execute a Perl script in another Perlscript
Message-Id: <MPG.13f4de7d1bc87f9198968a@news.concentric.net>
> > > > > how do i execute an cgi-script(written in Perl) within another cgi-
> > > > > script (written in Perl).
Can't you just make the script you're calling into a library, and then
use require("XXX") from the calling script? This does, however (I could
be wrong here) mean that you can't use the script being called as a
script anymore, ie calling it directly. However, you can just write a
calling script for the library if you want to use it directly, something
like:
#!usr/bin/perl
require("your_library.cgi");
&subroutine_within_your_library.cgi
That should take care of everything. There might be a better way of
doing it, but this way WILL work.
> > Holy Moly! Temper, temper there Mr. Schilbach. If he says he feels it's an
> > excellent question let him have his feeling. There's no reason for the
> > nastiness.
Aye, he may feel that it's an excellent question, but it is one that is
VERY easily answered without posting it here, which makes it, as they
say, a horrible, horrible question, at least in the eyes of those who
know the answer.
Whatever, I try to answer whatever questions I can (not many) but I'd
imagine that one day, I too will grow tired of answering the same
questions, day in and day out. *sigh* Hopefully at that point I'll know
more than I do now and at least I'll be happy.
bean
------------------------------
Date: Fri, 04 Aug 2000 15:36:22 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: execute a Perl script in another Perlscript
Message-Id: <398B1B36.D84F52C2@attglobal.net>
bean wrote:
>
>
> Aye, he may feel that it's an excellent question, but it is one that is
^^^
Keeping with Avast's pirate theme are we?
------------------------------
Date: 04 Aug 2000 15:46:05 EDT
From: bean <bean@agentkhaki.com>
Subject: Re: execute a Perl script in another Perlscript
Message-Id: <MPG.13f4e54182d0a4ad98968e@news.concentric.net>
> Keeping with Avast's pirate theme are we?
Only if I don't have to walk the plank again. Last time I got splinters
in my feet and the water was _really_ cold. We won't even get into the
nasties in the water.
bean
------------------------------
Date: Fri, 4 Aug 2000 22:00:15 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: execute a Perl script in another Perlscript
Message-Id: <Pine.GHP.4.21.0008042158520.13101-100000@hpplus03.cern.ch>
On Fri, 4 Aug 2000, AvastYeMatey quotes the entire history of usenet
in order to regale us with:
> Meant to chide Mr. NoBull, NOT Mr. Schilbach.
Which reminds me, I meant to adjust my scorefile last time I saw you.
------------------------------
Date: Fri, 04 Aug 2000 20:21:36 GMT
From: David Ness <DNess@Home.Com>
Subject: Re: execute a Perl script in another Perlscript
Message-Id: <398B25C9.C0AB9994@Home.Com>
bean wrote:
>
> > Keeping with Avast's pirate theme are we?
>
> Only if I don't have to walk the plank again. Last time I got splinters
> in my feet and the water was _really_ cold. We won't even get into the
> nasties in the water.
>
> bean
I thought that was `Walking the plonk' in the case of newsgroups...
------------------------------
Date: 04 Aug 2000 15:52:50 EDT
From: abigail@foad.org (Abigail)
Subject: Re: Gee, thanks for all the help :-(
Message-Id: <slrn8om7o2.pjo.abigail@alexandra.foad.org>
Phil Hawkins (tarheel@sierratel.com) wrote on MMDXXX September MCMXCIII
in <URL:news:398A4CEC.8BD01EB6@sierratel.com>:
|| I have posted here twice in two days begging for help from you all and
|| NO ONE seems to think my question merits anyone's attention.
||
|| Nice group. Real f****** nice group.
||
|| [ ... Snip ... ]
||
|| Java was easier than this...
It sure is. Lots and lots easier. The Java people are a lot more
friendly too. Perl is for masochistic morons, who like to insult others.
Abigail
--
perl -wle 'print "Prime" if (0 x shift) !~ m 0^\0?$|^(\0\0+?)\1+$0'
------------------------------
Date: Fri, 04 Aug 2000 20:00:59 GMT
From: nvp@spamnothanks.speakeasy.org (NP)
Subject: Re: Gee, thanks for all the help :-(
Message-Id: <%hFi5.527214$VR.6523973@news5.giganews.com>
On 04 Aug 2000 15:52:50 EDT, Abigail <abigail@foad.org> wrote:
:
: It sure is. Lots and lots easier. The Java people are a lot more
: friendly too. Perl is for masochistic morons, who like to insult others.
Don't forget that Java is cuter, too! :-)
--
Nate II
------------------------------
Date: Fri, 04 Aug 2000 20:08:53 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: Gee, thanks for all the help :-(
Message-Id: <7a7l9weqll.fsf@merlin.hyperchip.com>
Phil Hawkins <tarheel@sierratel.com> writes:
> I have posted here twice in two days begging for help from you all and
> NO ONE seems to think my question merits anyone's attention.
>
> Nice group. Real f****** nice group.
Since no body here is paid to answer any questions, no body should
expect their questions to be answered.
We have problems of our own, you know ...
--Ala
------------------------------
Date: Fri, 04 Aug 2000 15:25:26 -0500
From: Russ Jones <russ_jones@rac.ray.com>
Subject: Re: Gee, thanks for all the help :-(
Message-Id: <398B26B6.91EA581A@rac.ray.com>
NP wrote:
>
> On 04 Aug 2000 15:52:50 EDT, Abigail <abigail@foad.org> wrote:
> :
> : It sure is. Lots and lots easier. The Java people are a lot more
> : friendly too. Perl is for masochistic morons, who like to insult others.
>
> Don't forget that Java is cuter, too! :-)
>
But it's butt-ugly sitting on a bar stool!
--
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747
Quae narravi, nullo modo negabo. - Catullus
------------------------------
Date: Fri, 04 Aug 2000 16:33:31 -0500
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Re: Gee, thanks for all the help :-(
Message-Id: <398B36AB.29D6513C@mindspring.com>
Abigail wrote:
>
> Phil Hawkins (tarheel@sierratel.com) wrote on MMDXXX September MCMXCIII
> in <URL:news:398A4CEC.8BD01EB6@sierratel.com>:
> || I have posted here twice in two days begging for help from you all and
> || NO ONE seems to think my question merits anyone's attention.
> ||
> || Nice group. Real f****** nice group.
> ||
> || [ ... Snip ... ]
> ||
> || Java was easier than this...
>
> It sure is. Lots and lots easier. The Java people are a lot more
> friendly too. Perl is for masochistic morons, who like to insult others.
>
Surely you mean *sadistic* morons. Masochistic morons would like to
*be* insulted (though, being morons, the insults would have to be dumbed
down).
------------------------------
Date: 04 Aug 2000 15:56:27 EDT
From: abigail@foad.org (Abigail)
Subject: Re: get files from other servers
Message-Id: <slrn8om7ur.pjo.abigail@alexandra.foad.org>
Louie G. Kim (gk@bncol.com) wrote on MMDXXX September MCMXCIII in
<URL:news:8me1l1$cvp$1@news2.kornet.net>:
// Is there any way to get files from other servers?
//
// When i am on server A, I want to get fileA from server B or
// I want to display fileA at server B.
Sure. One could use NFS, or UUCP.
What does this have to do with Perl?
Abigail
--
sub J::FETCH{Just }$_.='print+"@{[map';sub J::TIESCALAR{bless\my$J,J}
sub A::FETCH{Another}$_.='{tie my($x),$';sub A::TIESCALAR{bless\my$A,A}
sub P::FETCH{Perl }$_.='_;$x}qw/J A P';sub P::TIESCALAR{bless\my$P,P}
sub H::FETCH{Hacker }$_.=' H/]}\n"';eval;sub H::TIESCALAR{bless\my$H,H}
------------------------------
Date: Fri, 04 Aug 2000 20:23:11 GMT
From: Edge <edge@gecko.org>
Subject: Getting program name - how?
Message-Id: <8mf8n9$ada$1@nnrp1.deja.com>
I know that $0 will give you the program name, but it also includes the
full path...ie: /usr/local/bin/name_of_program or ./name_of_program
Is there a quick way to determine just 'name_of_program'? I realize I
can hardcode the name into the script, but if the file itself gets
renamed it might cause confusion (userX runs 'myProgram' and sees
'programXYZ' in the help/description/etc)
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 04 Aug 2000 15:35:54 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Getting program name - how?
Message-Id: <87ya2cg3x1.fsf@limey.hpcc.uh.edu>
>> On Fri, 04 Aug 2000 20:23:11 GMT,
>> Edge <edge@gecko.org> said:
> I know that $0 will give you the program name, but it
> also includes the full path...ie:
> /usr/local/bin/name_of_program or ./name_of_program
> Is there a quick way to determine just
> 'name_of_program'?
use File::Basename;
my $progname = basename($0);
is one way to do it.
hth
t
--
"With $10,000, we'd be millionaires!"
Homer Simpson
------------------------------
Date: Fri, 04 Aug 2000 21:09:31 GMT
From: Edge <edge@gecko.org>
Subject: Re: Getting program name - how?
Message-Id: <8mfbe7$cgq$1@nnrp1.deja.com>
Thanks! works perfectly
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
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 3917
**************************************