[10485] in Perl-Users-Digest
Perl-Users Digest, Issue: 4077 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 26 22:05:36 1998
Date: Mon, 26 Oct 98 19:00:22 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 26 Oct 1998 Volume: 8 Number: 4077
Today's topics:
Array to Hash Keys <thelma@alpha2.csd.uwm.edu>
Re: Array to Hash Keys <tupshin@tupshin.com>
Re: Array to Hash Keys (Larry Rosler)
Re: Camel book: References. (Kevin Reid)
Catching aborted Perl script <kmattson@qualcomm.com>
cgi param transfer? <yuming@cusun.ims.att.com>
Re: cgi param transfer? (Martien Verbruggen)
Re: CPAN.pm and socks (Martien Verbruggen)
Re: Date Comparision (Kevin Reid)
Re: Displaying the Time (Craig Berry)
Re: Forcing perl to garbage collect (David Formosa)
Re: getting the date & time directly from perl <ChintanA@worldnetcorp.com>
Re: How to build perl 5.005 in WinNT? (Martien Verbruggen)
Re: Is this possible? Apache/FreeBSD/CGI <--> NT/MSSQL <bill@fccj.org>
Re: newbie MAIL question (Joergen W. Lang)
Re: Not to start a language war but.. <jorendorff@ixl.com>
Re: Not to start a language war but.. (Abigail)
Re: Not to start a language war but.. (Sam Holden)
Re: Opendir and Readdir not working as expected (Honza Pazdziora)
Re: Perl & Y2K - booby trap code jkane@my-dejanews.com
Re: Perl & Y2K - booby trap code <jdporter@min.net>
Re: Perl & Y2K - booby trap code (Craig Berry)
Re: Perl & Y2K - booby trap code (Sam Holden)
Re: Perl Interpreter (Martien Verbruggen)
Re: Perl require not always finishing on NT <metcher@spider.herston.uq.edu.au>
Re: Please Help ! Web Site Maintenance Question (Tad McClellan)
Re: Q: Opinions on Perl/Qt? (Dave)
Re: Script wanted... <nobody@noplace.com>
Re: Sending mail using perl <murrayb@vansel.alcatel.com>
Re: What isn't Perl good for? (Alastair)
Re: What isn't Perl good for? (Michael Lewchuk)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 27 Oct 1998 00:47:12 GMT
From: Thelma Lubkin <thelma@alpha2.csd.uwm.edu>
Subject: Array to Hash Keys
Message-Id: <71356g$2so$1@uwm.edu>
This has to be a FAQ, but I just can't find it.
I want
%hash_table keys = @aray or
%hash_table keys = <IN>, where IN, is of course, a filehandle.
Isn't there something snappier than
foreach (@aray) { $hash_table{$_} = 0; }
while (<IN>) { $hash_table{$_} = 0; }
Actually, these are just 1/2 liners--perhaps I shouldn't be looking
for better...but...
--thelma
------------------------------
Date: 26 Oct 1998 17:26:36 PST
From: "Tupshin Harper" <tupshin@tupshin.com>
Subject: Re: Array to Hash Keys
Message-Id: <newscache$ccpg1f$3x1@debian>
Well...couldn't think of a precise answer to your question, but if your
input data could easily be made to take the form of every other element of
an array
(e.g. $array[1]="key1"; $array[3]="key2"; etc.),
then:
%hash=reverse @array;
would do exactly that.
-Tupshin Harper
-Programmer/Network Administrator
-Studio Verso
Thelma Lubkin wrote in message <71356g$2so$1@uwm.edu>...
>This has to be a FAQ, but I just can't find it.
>
>I want
> %hash_table keys = @aray or
> %hash_table keys = <IN>, where IN, is of course, a filehandle.
>
>Isn't there something snappier than
>
> foreach (@aray) { $hash_table{$_} = 0; }
> while (<IN>) { $hash_table{$_} = 0; }
>
>Actually, these are just 1/2 liners--perhaps I shouldn't be looking
>for better...but...
> --thelma
------------------------------
Date: Mon, 26 Oct 1998 17:05:44 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Array to Hash Keys
Message-Id: <MPG.109ebc46bac40b1598983e@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and a copy mailed.]
In article <71356g$2so$1@uwm.edu> on 27 Oct 1998 00:47:12 GMT, Thelma
Lubkin <thelma@alpha2.csd.uwm.edu> says...
> This has to be a FAQ, but I just can't find it.
It's not, as far as I can see.
> I want
> %hash_table keys = @aray or
> %hash_table keys = <IN>, where IN, is of course, a filehandle.
>
> Isn't there something snappier than
>
> foreach (@aray) { $hash_table{$_} = 0; }
> while (<IN>) { $hash_table{$_} = 0; }
>
> Actually, these are just 1/2 liners--perhaps I shouldn't be looking
> for better...but...
There *is* better == snappier, as defined by "much faster": the hash
slice.
@hash_table{ @aray } = (0) x @aray;
In the second case, where you don't know how many elements there are a
priori, if all you're interested in are the hash keys and the values may
be undefined (as seems likely from your problem statement):
@hash_table{ <IN> } = ();
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 26 Oct 1998 19:41:18 -0500
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: Camel book: References.
Message-Id: <1dhioxj.sse6m14tvndfN@slip166-72-108-85.ny.us.ibm.net>
Darrin Edwards <d-edwards@nospam.uchicago.edu> wrote:
> If you give me, in C, a pointer to one of your precious data
> structures -- something nice and OO, with lots of intricate
> internal parts you'd rather not have us greasy-fingered users
> touch -- guess what, (char *)p points to the first byte, (char *)p+1
> to the second, I can stomp right through it byte by byte!
>
> If I give you, in perl, a ref to one of my hacked-up data
> structures, yadda yadda -- guess what, perl doesn't allow
> pointer arithmetic.
Actually, Perl does something better - it lets you look at the data
structure and find out what sort of things the elements are, allowing
you to easily figure out the structure.
--
Kevin Reid. | Macintosh.
"I'm me." | Think different.
------------------------------
Date: Mon, 26 Oct 1998 14:57:28 -0800
From: Kevin Mattson <kmattson@qualcomm.com>
Subject: Catching aborted Perl script
Message-Id: <3634FE58.4EF5@qualcomm.com>
How can I detect when a user has hit CNTRL-C or CNTRL-break from the
keyboard? I'd like to catch this action and do some clean-up before
exiting the script.
I'm using ActiveState's ActivePerl Build 502 on Win NT. The previous
version I was using (Build 316), threw a "__DIE__" signal when the user
hit CNTRL-C, but it doesn't appear to do it anymore.
Any ideas?
Thanks,
Kevin Mattson
------------------------------
Date: Mon, 26 Oct 1998 17:25:56 -0600
From: Yuming Huang <yuming@cusun.ims.att.com>
Subject: cgi param transfer?
Message-Id: <Pine.SOL.3.96.981026172419.13475B-100000@cusun.ims.att.com>
Hello,
A question about parameter transfer in cgi code.
I know one form--Form 1:
...?...&...&... cgi_code_name?param1=value1¶m2=value2...
However, I met another form--Form 2: .../.../.../...
cgi_code_name/param1=value1/param2=value2...
at www.mapsonus.com.
After you registered(free), you'll find this. Some
values here are processed, like password. It's good as in first case, the
password is in its original form in the ...?...&...&... structure which
is very dangous.
My question is, how does Form 2 work? It seems that some processing is
done on the client side. How can we know how the processing is done?
Thanks,
Yuming
------------------------------
Date: Tue, 27 Oct 1998 00:56:29 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: cgi param transfer?
Message-Id: <1T8Z1.141$z05.208782@nsw.nnrp.telstra.net>
In article <Pine.SOL.3.96.981026172419.13475B-100000@cusun.ims.att.com>,
Yuming Huang <yuming@cusun.ims.att.com> writes:
> A question about parameter transfer in cgi code.
Indeed, a question about CGI. Not about perl. So why are you posting
this to comp.lang.perl.misc? You should be posting this to one of the
comp.infosystems.www.* groups. At least one of them talks about CGI.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | "In a world without fences,
Commercial Dynamics Pty. Ltd. | who needs Gates?"
NSW, Australia |
------------------------------
Date: Mon, 26 Oct 1998 23:17:37 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: CPAN.pm and socks
Message-Id: <lq7Z1.109$z05.132585@nsw.nnrp.telstra.net>
In article <x97vhl7qlgn.fsf@fat-tire.col.hp.com>,
Bill Geddes <geddes@pavlov.col.hp.com> writes:
>
> I'm trying to get the CPAN module to configure using socks, not proxies.
> It doesn't seem to be working.
> I point it at either a socksified ftp binary, or to a script that
> exports SOCKS-SERVER and SOCKS_NS and calls the socksified ftp client.
> No luck.
> Something's likely obvious - but I've missed it.
The CPAN module will try to use perl modules and internal perl
functions as well. To be successful you most likely need to run perl
socksified. If you can't have a socksified perl installed, you can
dynamically run it socksified with
# runsocks perl -MCPAN -e shell
if your socks installation is complete.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | "In a world without fences,
Commercial Dynamics Pty. Ltd. | who needs Gates?"
NSW, Australia |
------------------------------
Date: Mon, 26 Oct 1998 19:41:20 -0500
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: Date Comparision
Message-Id: <1dhip1s.30u1yo10gp5o5N@slip166-72-108-85.ny.us.ibm.net>
Matt Knecht <hex@voicenet.com> wrote:
> $date1 = tr/- ://d;
> $date2 = tr/- ://d;
s/=/=~/g;
--
Kevin Reid. | Macintosh.
"I'm me." | Think different.
------------------------------
Date: 26 Oct 1998 23:09:31 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Displaying the Time
Message-Id: <712vfb$6o$1@marina.cinenet.net>
Craig Berry (cberry@cinenet.net) wrote:
: Larry Palkendo (lap@pop.net) wrote:
: : You can try the following which should do what you want it to
: :
: : $currtime = time();
: : $time = localtime($currtime);
: :
: : print "$time\n";
:
: Sure seems a long-winded way to express
:
: print scalar localtime;
Oops: s/;/, "\n";/
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| "Ripple in still water, when there is no pebble tossed,
nor wind to blow..."
------------------------------
Date: 27 Oct 1998 00:36:08 GMT
From: dformosa@zeta.org.au (David Formosa)
Subject: Re: Forcing perl to garbage collect
Message-Id: <slrn73a5bo.9fi.dformosa@godzilla.zeta.org.au>
In article <712srv$3r1$1@mathserv.mps.ohio-state.edu>, Ilya Zakharevich wrote:
>[A complimentary Cc of this posting was sent to Michael J Gebis
><gebis@fee.ecn.purdue.edu>],
>who wrote in article <712i4p$k14@mozo.cc.purdue.edu>:
>> I also think that 1) you can't force perl to garbage collect without
>> exiting
>
>Perl does not collect garbage. At all. (Except primitive refcounting.)
So the "nuke and pave" garbage collection when perl finishes is?
--
Please excuse my spelling as I suffer from agraphia. See the URL in my
header to find out more.
------------------------------
Date: Mon, 26 Oct 1998 16:50:50 -0600
From: Chintan Adhyapak <ChintanA@worldnetcorp.com>
Subject: Re: getting the date & time directly from perl
Message-Id: <3634FCCA.E731B76C@worldnetcorp.com>
Not really native Perl equivalent but....
($sec,$min,$hour,$mday,$mon,$year) = localtime(time);
$mon++;
if (length($mday)==1) { $mday="0".$mday } # pad a 0 if 1 digit
same for other vars
$sysdate=$mday$mon$year;
Gavin Cato wrote:
>
> Hello All,
>
> Is there a native perl equivalent to something like
>
> system (" date +%d%m%y ");
>
> ?
>
> Thanks
>
> ++Gavin;
--
________________
Chintan Adhyapak
------------------------------
Date: Mon, 26 Oct 1998 22:55:45 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: How to build perl 5.005 in WinNT?
Message-Id: <R57Z1.101$z05.132585@nsw.nnrp.telstra.net>
In article <3633D29B.61FA47C@hotmail.com>,
Robert Shriver Barnes <sailorbob24@hotmail.com> writes:
> The question is fairly basic. I would like to embed a bare bones perl
> compiler in a Borland C++ Builder 3.0 app under WinNT. I downloaded
> the perl5.005_2 source code package and after reading the readme.win32
> and other docs I'm a little confused. Anyone have experiance in this
> area?
Did those other docs include the perlembed documentation?
# perldoc perlembed
If you already read that, ignore this post.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | "In a world without fences,
Commercial Dynamics Pty. Ltd. | who needs Gates?"
NSW, Australia |
------------------------------
Date: Mon, 26 Oct 1998 21:48:14 -0500
From: Bill Jones <bill@fccj.org>
Subject: Re: Is this possible? Apache/FreeBSD/CGI <--> NT/MSSQL
Message-Id: <3635346E.256A0EA1@fccj.org>
ihomebrew@my-dejanews.com wrote:
> Here is my question: I've never written a line of CGI (but I have done
> plenty 'o Perl) but is it possible to configure an Apache/FreeBSD/CGI app to
> talk to a MSSQL server? I saw DBI::Net but it looks like it isn't for MSSQL.
Lookup ODBC for Unix...
-Sneex-
________________________________________________________________________
Bill Jones | FCCJ Webmaster | x3089 | http://webmaster.fccj.org:81
------------------------------------------------------------------------
__ _ RedHat 5.1 Manhatten
/ /(_)_ __ _ ___ __ http://www.apache.org
/ / | | '_ \| | | \ \/ / http://www.redhat.com
/ /__| | | | | |_| |> < http://www.perl.com
\____/_|_| |_|\__,_/_/\_\ http://www.gimp.org
------------------------------
Date: Tue, 27 Oct 1998 00:46:08 +0100
From: jwl@_munged_worldmusic.de (Joergen W. Lang)
Subject: Re: newbie MAIL question
Message-Id: <1dhj2dt.11ekjqj1jq1bmlN@host006-210.seicom.net>
fred <fred@somewhere.com> wrote:
> I'm having trouble with what is only my second Perl script. I am just
> trying to send an email. It DOES work -- the email is sent, but in the
> email message that goes out the Subject line appears blank and instead
> the Subject text appears in the body of the message (followed by what I
> wanted to be the body of the message).
>
> Any ideas? I know I'm missing the obvious.
>
> #!/usr/bin/perl5
#!/usr/bin/perl -w
>
> $mailprog = '/usr/sbin/sendmail';
> $recipient = 'fred@somewhere.com';
> $email = 'fred@somewhere.com';
> print "Content-type: text/plain\n\n";
print a Content-type header to STDOUT ? What for ?
> open (MAIL, "|$mailprog $recipient") || die "unable to send request\n";
open MAIL, "|mailprog $recipient"
or die "unable to send request: $!";
> print MAIL "Reply-to: $email\n\n";
One newline too much. This messes up your headers.
> print MAIL "Subject: My Test\n\n";
>
> print MAIL "This is the message to print";
>
> close (MAIL);
> print "it worked";
hth, HANT,
Joergen
--
To reply by email please remove _munged_ from address Thanks !
-------------------------------------------------------------------
"Everything is possible - even sometimes the impossible"
HOELDERLIN EXPRESS - "Touch the void"
------------------------------
Date: Mon, 26 Oct 1998 18:37:19 -0800
From: Jason Orendorff <jorendorff@ixl.com>
Subject: Re: Not to start a language war but..
Message-Id: <363531DF.5CDBC632@ixl.com>
> (1) What about garbage collection?
>
> The last time I looked at Python, it worked via ONLY
> ref-counts; ie, could not gc circular lists, anything
> with backpointers, etc.
>
> Seemed to me like a real loss, compared to perl's.
Uh, last time I checked, Perl did a mark and sweep only when modules
got cleaned up. Neither Perl nor Python has "true" GC in the sense
that Java has it. (But there is an implementation of Python for
Java, and it uses Java's GC.)
Personally I never use either language for anything where it
approaches being a problem; if i did I'd switch to Java. :-)
As for there not being any books, check out
http://www.python.org/doc/tut/tut.html ... spend four hours,
learn the whole language. Then tell my why you need a book.
*grin*
--
jason
------------------------------
Date: 27 Oct 1998 01:03:36 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Not to start a language war but..
Message-Id: <713658$471$1@client3.news.psi.net>
James Logajan (JamesL@Lugoj.Com) wrote on MDCCCLXXXII September MCMXCIII
in <URL:news:3634CF69.7F001D43@Lugoj.Com>:
++
++ Yes, context is important, but you are missing an important aspect: the
++ scale on which context is taken. The context scale of Perl is too small,
++ which is why many people consider the language cluttered. Consider the
++ following two imaginary language examples:
++
++ Example 1:
++ $b = 42
++ $a = $b + 5
++ $a = $a * 9
++
++ Example 2:
++ integer a, b
++ b = 42
++ a = b + 5
++ a = a * 9
++
++ Perl tries to provide context information at the token level; hence we
++ are told no less than 3 times in 2 lines that "a" is a string (but we
++ do numeric operations on it!).
It isn't at all surprising if you know Perl. Not really well, just a tiny
bit. Then you would know that '$' is used for *scalars*, and Perl will
figure out if you want a string, integer, float, or reference.
++ That is over-kill (and misleading in the
++ end anyway!) The declarative version tells us once that "a" is really
++ an integer. But we have to include a larger context to see that.
++ Python does away with the declaration of course, and uses the assignment
++ to provide the information on the data type of "a" in the context of
++ the 3 lines.
Hmm, sure. But in Perl I can write "The answer is $a", just like in
the shell. And if I have a variable $goobelygook, and I upgrade Perl
with the new version of Perl having a function called 'goobelygook'
(or I use a Module that exports a function 'goobelygook') I won't have
any name clashes.
Using '$', '@', '%', '*' or '&' as prefixes for variables doesn't make
Perl a better language than Python, nor does it make Perl less than
Python. Perl just made a different choice; if you don't like, don't
use it.
++ Do you understand now why some of us really dislike this aspect of
++ Perl, or am I writing on at length to no avail?
Then don't use Perl.
Abigail
--
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
"\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
"\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'
------------------------------
Date: 26 Oct 1998 23:05:07 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Not to start a language war but..
Message-Id: <slrn73a013.kmo.sholden@pgrad.cs.usyd.edu.au>
On Mon, 26 Oct 1998 21:11:34 GMT, David Combs <dkcombs@netcom.com> wrote:
>(1) What about garbage collection?
>
>The last time I looked at Python, it worked via ONLY
>ref-counts; ie, could not gc circular lists, anything
>with backpointers, etc.
>
>Seemed to me like a real loss, compared to perl's.
But perl also uses a reference count and thus doesn't garbage collect
self-referential constructs....
--
Sam
Of course, in Perl culture, almost nothing is prohibited. My feeling is
that the rest of the world already has plenty of perfectly good
prohibitions, so why invent more? --Larry Wall
------------------------------
Date: Mon, 26 Oct 1998 22:04:52 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Opendir and Readdir not working as expected
Message-Id: <slrn739sg5.lce.adelton@aisa.fi.muni.cz>
On 26 Oct 1998 21:03:42 GMT, Walter Smith <smithw@nospam.spam.com> wrote:
> The following script I expected to list all the files
> in the given directory, but all it returns is ".".
>
> #!/usr/local/bin/perl
> chdir "/etc/lvmconf/";
> opendir(DIR,".") || die "cant open /etc/lvmconf";
> #opendir(DIR,"/etc/lvmconf/") || die "cant open /etc/lvmconf";
> print `pwd`;
> @files = readdir(DIR) || die "cant readdir";
Put or here instead.
Otherwise you are forcing a scalar context on the readdir, which will
give you what it gives you.
Hope this helps,
--
------------------------------------------------------------------------
Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
I can take or leave it if I please
------------------------------------------------------------------------
------------------------------
Date: Mon, 26 Oct 1998 22:39:17 GMT
From: jkane@my-dejanews.com
To: merlyn@stonehenge.com
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <712tml$657$1@nnrp1.dejanews.com>
In article <8c1zo2t321.fsf@gadget.cscaper.com>,
Randal Schwartz <merlyn@stonehenge.com> wrote:
> If a sloppy programmer wrote "19$year" instead of ($year + 1900),
> that's *their* fault. STOP BLAMING PERL.
Dumb newbie question RAndall, But if I may ...
When I look at the output of localtime, it is only two digits. When 2000
rolls around, won't $year += 1900 still give 1900? I am obviously missing
something major here.
I have to write an output file with the date in it, and this is going to be an
issue for me now.
Thanks and I hope this is not a FAQ. :{ (
-Jeff Kane
jeff_kane@northwesternmutual.com
or jkane@execpc.com
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Mon, 26 Oct 1998 18:24:04 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <36350494.C532BAB9@min.net>
jkane@my-dejanews.com wrote:
>
> When I look at the output of localtime, it is only two digits. When 2000
> rolls around, won't $year += 1900 still give 1900? I am obviously missing
> something major here.
Yes, you haven't seen what the output of localtime will be when 2000 rolls
around. Hint: 100.
$year += 1900;
will then give you the 2000 you wanted.
--
John "Throbblefoot" Porter
Please Don't "Courtesy CC" me.
I read this newsgroup fanatically. You know that!
("Emailed only" is fine, though.)
"The people at the Grey Hotel
Are either aged or unwell." -- EG
------------------------------
Date: 26 Oct 1998 23:13:48 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <712vnc$6o$2@marina.cinenet.net>
jkane@my-dejanews.com wrote:
: In article <8c1zo2t321.fsf@gadget.cscaper.com>,
: Randal Schwartz <merlyn@stonehenge.com> wrote:
: > If a sloppy programmer wrote "19$year" instead of ($year + 1900),
: > that's *their* fault. STOP BLAMING PERL.
:
: Dumb newbie question RAndall, But if I may ...
:
: When I look at the output of localtime, it is only two digits. When 2000
: rolls around, won't $year += 1900 still give 1900? I am obviously missing
: something major here.
How can you conclude that?? Seriously, what sort of logic is behind that
question? The localtime year value gives years since 1900. 1998 becomes
98, 1999 becomes 99, and 2000 becomes...100! The fact that localtime is
currently returning two digits, and has been doing so since Unix came into
existence, is mere coincidence. In 1908 it would have returned 1 digit,
in 2000 it will return 3 digits.
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| "Ripple in still water, when there is no pebble tossed,
nor wind to blow..."
------------------------------
Date: 27 Oct 1998 00:47:22 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <slrn73a60q.mba.sholden@pgrad.cs.usyd.edu.au>
On Mon, 26 Oct 1998 22:39:17 GMT, jkane@my-dejanews.com
<jkane@my-dejanews.com> wrote:
>In article <8c1zo2t321.fsf@gadget.cscaper.com>,
> Randal Schwartz <merlyn@stonehenge.com> wrote:
>
>> If a sloppy programmer wrote "19$year" instead of ($year + 1900),
>> that's *their* fault. STOP BLAMING PERL.
>
>Dumb newbie question RAndall, But if I may ...
>
>When I look at the output of localtime, it is only two digits. When 2000
>rolls around, won't $year += 1900 still give 1900? I am obviously missing
>something major here.
>
>I have to write an output file with the date in it, and this is going to be an
>issue for me now.
>
>Thanks and I hope this is not a FAQ. :{ (
Why don't you go and read the FAQ to find out first.
=head2 Does Perl have a year 2000 problem? Is Perl Y2K compliant?
--
Sam
Perl was designed to be a mess (though in the nicest of possible ways).
--Larry Wall
------------------------------
Date: Mon, 26 Oct 1998 23:15:42 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Perl Interpreter
Message-Id: <yo7Z1.107$z05.132585@nsw.nnrp.telstra.net>
In article <712ae4$fnr$1@excalibur.flash.net>,
"Josh Barfield" <JoshB@flash.net> writes:
> I need a Perl Interpreter. I've tried http://www.perl.com, but I don't
> really understand their's
That is the only one available though. What don't you understand about
it? Are you maybe on a DOS-derived box, and you don't understand that
there isn't a double-clickable installation program for you? Try
www.activestate.com. They maintain the win32 version of perl.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | "In a world without fences,
Commercial Dynamics Pty. Ltd. | who needs Gates?"
NSW, Australia |
------------------------------
Date: Tue, 27 Oct 1998 11:35:02 +1000
From: Jaime Metcher <metcher@spider.herston.uq.edu.au>
Subject: Re: Perl require not always finishing on NT
Message-Id: <36352346.8524AC36@spider.herston.uq.edu.au>
Try putting:
1;
at the end of your library file to force it to return a true value.
Otherwise it's return value will be the value of the last statement,
which could depend on the context in which in was require'd.
--
Jaime Metcher
gregghill@my-dejanews.com wrote:
>
> We've had an intermittent problem lately that sounds to me like the Perl
> require statment doesn't ALWAYS read in the entire file before the compile
> phase starts.
>
> The server is NT 4.0 SP3 w/ IIS 3.0 and Perl for Win32 Build 315 (5.003_07)
>
> I have a set of .cgi routines that all 'require' a common library file. The
> routines work 99.9% of the time, but sometimes for no apparent reason they
> fail. As seen in the error listing below, the subroutine GET_FORM_FIELDS is
> undefined. Yet all of the .cgi routines use this subroutine to gather data
> from the form submitted. If the subroutine was really not defined, the
> script would NEVER work! Other errors include '... did not return a true
> value ...' -- but only sometimes. This should NEVER work if the require'd
> file didn't return a true value...
>
> As expected, clients then get the standard message one sees when a compile
> error occurs:
>
> CGI Error. The specified CGI application misbehaved by not returning a
> complete set of HTTP headers. The headers it did return are:
>
> (then nothing indicating the headers it did return)
>
> The same form re-submitted a moment later usually works just fine!
>
> Anyone else experience intermittent problems like this?
>
> PerlIS-Err.log
> *** 'E:\approot\cgi-bin\_sub_message_detail.cgi' error message at: 1998/10/26
> 08:13:46
> Missing right bracket at C:\Perl\lib/Exporter.pm line 31, at end of line
> syntax error at C:\Perl\lib/Exporter.pm line 31, at EOF
> BEGIN failed--compilation aborted at E:/approot/cgi-bin/common_lib.pl line 6.
>
> *** 'E:\approot\cgi-bin\_sub_enroll_detail.cgi' error message at: 1998/10/26
> 08:13:46
> Undefined subroutine &main::GET_FORM_FIELDS called at
> E:\approot\cgi-bin\_sub_enroll_detail.cgi line 17.
>
> *** 'E:\approot\cgi-bin\_sub_addr_detail.cgi' error message at: 1998/10/26
> 08:54:46
> Undefined subroutine &main::GET_FORM_FIELDS called at
> E:\approot\cgi-bin\_sub_addr_detail.cgi line 17.
>
> *** 'E:\approot\cgi-bin\_sub_enroll_detail.cgi' error message at: 1998/10/26
> 09:07:40
> E:/approot/cgi-bin/common_lib.pl did not return a true value at
> E:\approot\cgi-bin\_sub_enroll_detail.cgi line 5.
>
> *** 'E:\approot\cgi-bin\_sub_main_detail.cgi' error message at: 1998/10/26
> 09:12:39
> Can't locate /common_lib.pl in @INC at E:\approot\cgi-bin\_sub_main_detail.cgi
> line 5.
>
> *** 'E:\approot\cgi-bin\_sub_enroll_detail.cgi' error message at: 1998/10/26
> 09:12:39
> Undefined subroutine &main::GET_FORM_FIELDS called at
> E:\approot\cgi-bin\_sub_enroll_detail.cgi line 17.
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Mon, 26 Oct 1998 18:56:17 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Please Help ! Web Site Maintenance Question
Message-Id: <hn5317.i3a.ln@flash.net>
Baldy Scone (baldyscone@deathsdoor.com) wrote:
: I have a very large web site to administer, and now i need to change a few
: lines on every page on the site, reflecting some recent changes. This
: wouldn't be a problem if the site was locally hosted, but it is hosted on an
: ISP some 500 miles from my place of work.
: The server is unix, running perl 5.
: My question is, does anyone know of a script that will allow me to globally
: search and replace a text string on every .htm document on the site. I need
: this badly, and am even prepared to pay.!!
perl -p -i -e 's/www\.oldisp\.com/www.newisp.net/g' `find . -name '*.html'`
Better have good backups, or give the -i a filename extension.
(see perlrun man page)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 27 Oct 1998 01:13:43 GMT
From: not@anygood.net (Dave)
Subject: Re: Q: Opinions on Perl/Qt?
Message-Id: <36351c11.4702735@news.isoc.net>
On Mon, 26 Oct 1998 02:31:58 +0000, WMWilson <m.v.wilson@erols.com>
wrote:
>Dave wrote:
>>
>> I've been programming in Perl/Tk for a couple years on both UNIX and
>> Windows. We are finally moving to C++ in our group, and the Qt
>> widgets look like a better fit for C++ than Tk does. I assume using
>> Perl/Qt would allow mixing C++ and Perl in a GUI application that has
>> a single look and feel. Anybody out there besides me looking at or
>> already using Perl/Qt? Why or why not?
>>
>> I've already seen much of the KDE vs GNOME debate, and I'm confused
>> over the LGPL that comes with Perl/Qt. It's unclear to me whether
>> Perl/Qt can be used in a commercial environment. I tried emailing
>> Ashley Winters but the email bounced back. Can anyone else shed light
>> on this or know how to get in touch with Ashley?
>>
>> Thanks in advance,
>> Dave
>>
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> dlripberXisoc.net (sub X with shunned char)
>> http://www.isoc.net/dlripber
>>
>> /--\./==\./ee\./oo\./--\
>
>
> The debate about Qt is in the fact that it's license is not GPL/LGPL
>and, belonging to a commercial company, could change at their whim.
>Currently the license allows software created with it to be freely
>distributed, but if the company were to decide that they no longer felt
>so generous, a project meant to provide free software could suddenly be
>just a waste of 6 months or so.
Thanks for your comments, but we are a commercial business. We are
used to other businesses screwing us all the time :) Hewlett-Packard,
Intel, etc. Costing us hundreds of thousand of dollars. I'm not too
worried about Troll Tech.
The GPL and LGPL seem very incompatible with the commercial side. I
would hope Perl/Qt would be available under a purchased commercial
license or the "artistic license" like Perl.
Dave
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dlripberXisoc.net (sub X with shunned char)
http://www.isoc.net/dlripber
/--\./==\./ee\./oo\./--\
------------------------------
Date: Mon, 26 Oct 1998 17:16:57 -0800
From: "R.G." <nobody@noplace.com>
Subject: Re: Script wanted...
Message-Id: <713739$pld@sjx-ixn6.ix.netcom.com>
You might try www.extropia.net. They have a free BBS package done in Perl
(quite well, I might add) that you can pretty much drop and run. Assuming
you know a bit about configuring your server. It's also available in
Gunther and Selena's book "CGI/Perl Programming."
Good luck,
Rich
pegboy@eclipse.net wrote in message <3633600d.16481283@news.eclipse.net>...
>Hi, I am looking for a webbased email script, thats NOT pop3 or imap,
>but instead, user to user. It will be used for a cancer bbs, and I
>would like to enable users to have private/personals email available
>to them, so they can email other users on the system only..
>Thanks so much for any help!
>Chris
>pegboy@eclipse.net
------------------------------
Date: 26 Oct 1998 13:45:10 -0800
From: Brad Murray <murrayb@vansel.alcatel.com>
Subject: Re: Sending mail using perl
Message-Id: <uogqzyp3t.fsf@vansel.alcatel.com>
dtropea@ctron.com writes:
> I have created a perl cgi program that will take a html form and
> process the data. The question is once i process the data i
> know how to shove the data into a output file but i would like to
> also automatically send the data to a person via e-mail.
Net::SMTP
--
BMurray Q: "My prostate is swollen and I think it's a networking
SW Analyst problem. Can you help?"
Alcatel A: "Build a free Linux box, relinking the kernel
as follows ..." (Gary Abbott)
------------------------------
Date: Tue, 27 Oct 1998 01:04:15 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: What isn't Perl good for?
Message-Id: <slrn73aap8.57.alastair@calliope.demon.co.uk>
Michael Lewchuk <jlewchuk@junctionnet.com> wrote:
>I believe localization is my biggest concern: the ability to structure an
>entire program as a hierarchical series of modules, each containing its own
>environment. Such a task is natural in some ASM, C, heck, most programming
>languages, but not in perl.
Come on man. Why come to a _perl_ newsgroup and start arguing that it isn't a
programming language? Trolling?
What do you think a perl _module_ is? What do you think a perl hierarchical
module is? What about packages and namespaces?
>If words like "illegible", "unmaintainable", "buggy", and "incomprehensible"
>have no meaning for you, it's not my problem.
*plonk*
--
Alastair
work : alastair@psoft.co.uk
home : alastair@calliope.demon.co.uk
------------------------------
Date: Tue, 27 Oct 1998 00:47:25 GMT
From: jlewchuk@junctionnet.com (Michael Lewchuk)
Subject: Re: What isn't Perl good for?
Message-Id: <3635069f.795963@news.junctionnet.com>
On Sun, 25 Oct 1998 20:11:26 GMT, Daniel Grisinger
<dgris@rand.dimensional.com> wrote:
>> Those of you who have been
>> around computers for 20 years may understand this reference: if it's
>> a batch job, use PERL, if it's a program, use C/C++.
>
>Wow, you manage to be elitist, condescending, and utterly wrong
>all at the same time. The only thing I can think of that makes
>batch jobs any different from `programs' is that they generally
>are started from a scheduler rather than from a command prompt.
I wasn't trying to be elitist, condescending, and I don't believe I'm all that
wrong. Generally I was trying to form an analogy. If you didn't like it,
then perhaps it was a bad analogy. Perhaps not.
>> In other
>> words, if you were limited to using shell commands only, could you
>> do it? If so, use PERL.
>
>You seem to believe that the only functionality offered by perl
>is C<system()>, C<exec()>, and C<``>. This is obviously false,
No, I seem to believe that the most common/useful/easily managed tasks could
have been done with a lot of shellscript.
>as any programmer who has ever written a 10,000 line program in
>perl without using any of these constructs can attest.
Not that I would want to maintain said "program" ...
>> Also, from my POV, PERL is treated as a programming language, which it's not.
>
>Please elaborate on exactly how it is not a programming language.
I believe localization is my biggest concern: the ability to structure an
entire program as a hierarchical series of modules, each containing its own
environment. Such a task is natural in some ASM, C, heck, most programming
languages, but not in perl.
>You may want to include your definition of `programming language'
>for the benefit of us morons who think that perl qualifies.
First of all, I didn't call anyone a moron.
Second, my concerns are stated above.
>> If you try to treat it like one, you will fail miserably in producing good
>> code. Either it'll be illegible, unmaintainable, buggy, incomprehensible, or
>> all of the above. You'll try to turn a program into a batch job, thereby
>> producing a botch job instead.
>
>Wow, you can come up with snappy phrases that are easy to remember
>but contain absolutely no meaning. Do you work for Microsoft's PR
>department by chance?
If words like "illegible", "unmaintainable", "buggy", and "incomprehensible"
have no meaning for you, it's not my problem.
I have no relationship with MicroSoft.
>
>> The only reason to move from C/C++ to PERL is that you can do many high-level
>> useful things easily. PERL is not better than C/C++, it's just easier on the
>> brain and fingers for high-level tasks.
>
>Make up your mind. Can perl be used as a replacement for C/C++
>or not. You assert above that it cannot, then you provide what
>is, to me, the best reason of all to switch -- it's makes doing
>things easier.
High-level tasks only. Also, I did not assert that it could not be a
replacement for C/C++. I said that I didn't consider it a programming
language. The two are different. For example, APL can be a great replacement
for C/C++, if you're only doing matrix/vector manipulation.
>All in all, your post is incoherent,
Nope.
> contradictory,
Nope.
>and uses terms that are very poorly defined. Not to mention, it only
Perhaps.
>managed to elicit one or two responses. You have scored a 2
>out of a possible 10 on the troll-o-meter.
Not my goal.
>Daniel Grisinger dgris@perrin.dimensional.com
Michael J. Lewchuk
jlewchuk@junctionnet.com
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 4077
**************************************