[10464] in Perl-Users-Digest
Perl-Users Digest, Issue: 4056 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 23 17:05:02 1998
Date: Fri, 23 Oct 98 14:00:22 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 23 Oct 1998 Volume: 8 Number: 4056
Today's topics:
# url_get.pl 1.15 27 Sep 1995 <pjl39@prc.erinet.com>
Re: *Why* does clpm attract non-perl posts? <keithmur@mindspring.com>
Re: *Why* does clpm attract non-perl posts? <uri@fastengines.com>
any modules/code for Groupwise 5.1 <EDOUARD.BEAUGARD@NY.FRB.ORG>
Code to unpack a TCP header keydet89@yahoo.com
Re: filehandles, packages, :: and -> (David Huggins)
Re: From scalar to array to output?? <rbridal@bcl.net>
Re: Help with tree-like data structure (I think) (Snowhare)
How can I get a list of OS processes from Perl on NT <m-i-r-o-s-l-a-v.d-z-a-k-o-v-i-c @intel.com>
Re: How can I get a list of OS processes from Perl on N (Ethan H. Poole)
How to sort nslookup result by IP <dazimi@oradev.csis.csd.metrotor.on.ca>
Re: How to sort nslookup result by IP <uri@fastengines.com>
Re: Locking files under windows 98 (Andrew M. Langmead)
Re: MSQL dump from PERL script (John Stanley)
Re: New Module: File::Finder -- OO version of File::Fin (Tye McQueen)
Re: Perl & Y2K - booby trap code (Snowhare)
Re: Perl & Y2K - booby trap code <keithmur@mindspring.com>
Re: Perl & Y2K - booby trap code (Tye McQueen)
Re: Perl & Y2K - booby trap code (Matt Knecht)
Re: Perl & Y2K - booby trap code <uri@fastengines.com>
Re: Perl & Y2K - booby trap code (Snowhare)
Re: Perl & Y2K - booby trap code (Larry Rosler)
Re: Perl & Y2K - booby trap code (Mark-Jason Dominus)
Perl unix to nt port scheiner@my-dejanews.com
Re: Perl unix to nt port (Larry Rosler)
Re: Perl, dynamic loading, SCO OS 5 <bw@cs3.ecok.EDU>
Printing large integers readably (malgosia askanas)
reference to array (Boson)
Re: reference to array (Sean McAfee)
Re: reference to array <uri@fastengines.com>
Re: reference to array <uri@fastengines.com>
Socket Problem again <e.brauer@intershop.de>
Storing path info for access by many scripts <sean@select-systems.com>
Re: Storing path info for access by many scripts (Sean McAfee)
Re: Who can help me write full-text search engine in Pe (Snowhare)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 23 Oct 1998 15:45:06 -0400
From: Pete Lucuk <pjl39@prc.erinet.com>
Subject: # url_get.pl 1.15 27 Sep 1995
Message-Id: <3630DCC2.732DCC5D@prc.erinet.com>
While using this version of url_get.pl (1.15 27 Sep 1995) and trying to
GET
this page: http://www.snweb.com/gb/gnd/gnd.htm I get the following:
ERROR retrieving document (5) - 404 - Not found. File does not exist or
is
read protected
I think the problem is that the their server is using HTTP 1.1 and
url_get.pl has a problem with it. Am I right?, am I wrong? either way
what is the best way to resolve this problem? Is there a version of
url_get.pl out there that will handle this? If so where??
------------------------------
Date: Fri, 23 Oct 1998 15:13:08 -0500
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Re: *Why* does clpm attract non-perl posts?
Message-Id: <3630E354.A2A8B2BA@mindspring.com>
Well, when I was in my naive late 30's, instead of the mature and
seasoned 40 I find myself at now, I also seemed to think there was some
tight coupling between Perl and CGI. There's something about the more
general articles and books that are out there that must encourage folks
to make that connection stronger than it ought to be. Not that I can
cite anything.
By the way, I've not seen a flamewar addressing the trivial topic of
whether you should reply to a posting "on top" or "underneath". I
prefer "on top" myself. ;-)
David Alan Black wrote:
>
> What I don't get is.......
>
> If someone is interested in CGI programming and/or Web administration
> and/or the vagaries of Micros**t IE, etc., why wouldn't that person
> actually WANT to participate in the appropriate newsgroups?
>
> It's as if there's a premium on posting to comp.lang.perl.misc, and
> that, therefore, one's goal (whatever one's topic) should be to make a
> case for the appropriateness of one's posting there. Or - failing such
> a case - simply to post there, as if to say: "I'll be damned if I'll
> allow myself to be excluded from posting to the Great Newsgroup."
>
> This comes out particularly in people who, having had it pointed out to
> them that they are off-topic, repeat the behavior or even defend it (on
> the grounds that Perl is used for CGI programming, or whatever).
>
> Is there something going on I don't know about? Is everyone but me
> receiving, say, one dollar for every post to clpm? Raffle tickets?
> Reduced time in purgatory?
>
> Above and beyond these questions, I do have one practical suggestion.
> To wit: there are an awful lot of *answers* being provided on clpm to
> these off-topic questions, usually prefaced with, "Your question isn't
> really about Perl, but anyway..." or words to that effect. It may well
> be kind-hearted and good to field these questions - but I wonder whether
> perhaps such fielding could be confined to email. Otherwise, once past
> the hurdle of parenthetically mentioning the inappropriateness of the
> topic, we've got a thread on our hands.
>
> David Black
> dblack@pilot.njin.net
------------------------------
Date: 23 Oct 1998 16:42:45 -0400
From: Uri Guttman <uri@fastengines.com>
Subject: Re: *Why* does clpm attract non-perl posts?
Message-Id: <saraf2nko1l.fsf@camel.fastserv.com>
>>>>> "KGM" == Keith G Murphy <keithmur@mindspring.com> writes:
KGM> By the way, I've not seen a flamewar addressing the trivial topic
KGM> of whether you should reply to a posting "on top" or
KGM> "underneath". I prefer "on top" myself. ;-)
but you didn't edit the quote. and if you reply to various parts of the
quote it is hard to follow if you reply "on top". i don't like it also
as it tends to make no editing of quotes the norm. then you can't follow
the thread of several quotes (which can be hard in many cases anyway
with bad quoting mechanisms).
uri
--
Uri Guttman Fast Engines -- The Leader in Fast CGI Technology
uri@fastengines.com http://www.fastengines.com
------------------------------
Date: Fri, 23 Oct 1998 15:04:45 -0400
From: ED BEAUGARD <EDOUARD.BEAUGARD@NY.FRB.ORG>
Subject: any modules/code for Groupwise 5.1
Message-Id: <3630D34D.772C548F@NY.FRB.ORG>
I would like to use Perl to send e-mail via Groupwise, does anyone know
of any modules that will allow me to do this? This is under NT, etc.,
etc.
------------------------------
Date: Fri, 23 Oct 1998 19:33:53 GMT
From: keydet89@yahoo.com
Subject: Code to unpack a TCP header
Message-Id: <70qln1$p$1@nnrp1.dejanews.com>
I am looking for example code to unpack a packet header for
analysis.
Any assistance would be greatly appreciated.
thanks
Carv
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 23 Oct 1998 16:05:23 -0400
From: bn711@freenet.carleton.ca (David Huggins)
Subject: Re: filehandles, packages, :: and ->
Message-Id: <874ssv11to.fsf@freenet.carleton.ca>
miko@idocs.com writes:
>
> This code gleefully spits out the entire contents of "mime.txt".
> Now, suppose
> we change just two characters in line 3, the :: to -> like this:
>
> 3 DataCarton->headersfromfh(\*ARCHIVE);
>
> The function is still called, but the file handle is no longer passed as a
> file handle. No contents are spit out. I also followed the advice in the
No, the file handle is being passed, it's just that the name of the
package is being implicitly passed as the first argument.
What you missed in your investigations is that -> forces class context
on a subroutine call, whether or not that subroutine is actually
expecting it. So, this:
DataCarton->headersfromfh(\*ARCHIVE);
is actually equivalent to this:
DataCarton::headersfromfh('DataCarton', \*ARCHIVE);
This probably *is* a FAQ...
--
David Huggins-Daines - bn711@freenet.carleton.ca
PGP public key #63A8B719 on public key servers
fingerprint=4F 38 A2 34 E1 E0 B7 6E C3 DA 6C E3 C6 6A 05 62
------------------------------
Date: Fri, 23 Oct 1998 14:36:49 -0500
From: Rob Bridal <rbridal@bcl.net>
Subject: Re: From scalar to array to output??
Message-Id: <3630DAD1.3842B7F3@bcl.net>
How about just putting in this?
/(...)(...)(....)/;
print "(".$1.") ".$2."-".$3;
------------------------------
Date: 23 Oct 1998 13:24:35 -0600
From: snowhare@xmission.xmission.com (Snowhare)
Subject: Re: Help with tree-like data structure (I think)
Message-Id: <70ql5j$3m2$1@xmission.xmission.com>
Nothing above this line is part of the signed message.
[posted and mailed]
In article <F1AMGE.Bo8@freenet.akron.oh.us>, <aa204@acorn.net> wrote:
>I am attempting to parse my Netscape Communicator 4.5 for Linux bookamarks
>file. I want to load the entire file into some data structure for
>processing, but I am having trouble thinking about exacly how the records
>will be cnstructed.
[...]
>My final goal is to create an index which will display the level 1 headings
>in a side frame of a web page, and have each heading be a link which will
>load up the links and sub-headings in the same frame.
>
>Perhaps I don't need to do what I think I need to do to accomplish this?
Yup. You are largely re-inventing the wheel.
<URL:http://www.nihongo.org/snowhare/utilities/bookmarker/>
Benjamin Franz
Version: 2.6.2
iQCVAwUBNjDX7ujpikN3V52xAQGgmgP/b6oE65LYccZzbz+enN+mYU3z74SGyguo
RkWtMeBa+dl7+ncUZPSPGWC2IlzmLSboELRupUpHnoTpBtKSZiZgelqUqRKeLBrw
xlXhN8y2lBM06SNdi3G4RC7qyWgUn8DBqxauqoorapMGRcoHsrsqMx53cBsO45uy
9bdmXC5x4Q4=
=4Wg6
-----END PGP SIGNATURE-----
------------------------------
Date: Fri, 23 Oct 1998 12:14:33 -0700
From: "Miroslav Dzakovic" <m-i-r-o-s-l-a-v.d-z-a-k-o-v-i-c @intel.com>
Subject: How can I get a list of OS processes from Perl on NT
Message-Id: <70pt1r$ghu$1@scnews.sc.intel.com>
Hello,
if it was Perl running on Unix, I'd use 'ps' system command to look all
process id's on the system, or to ask for a specific one.
Is there anything similar to this I can use on NT?
Thank you.
------------------------------
Date: Fri, 23 Oct 1998 19:48:43 GMT
From: ehpoole@ingress.com (Ethan H. Poole)
Subject: Re: How can I get a list of OS processes from Perl on NT
Message-Id: <v45Y1.906$XN5.2571@news9.ispnews.com>
In article <70pt1r$ghu$1@scnews.sc.intel.com>,
m-i-r-o-s-l-a-v.d-z-a-k-o-v-i-c@intel.com says...
>
>Hello,
>
>if it was Perl running on Unix, I'd use 'ps' system command to look all
>process id's on the system, or to ask for a specific one.
>
>Is there anything similar to this I can use on NT?
If you have the Resource Kit, take a look at pulist.exe.
Note that this question would have been more aproppriate in an NT newsgroup
as it has nothing to do with Perl.
--
Ethan H. Poole | Website Design and Hosting,
| CGI Programming (Perl & C)..
========Personal=========== | ============================
* ehpoole @ ingress . com * | --Interact2Day--
http://home1.gte.net/ehp/ | http://www.interact2day.com/
------------------------------
Date: Fri, 23 Oct 1998 16:39:19 -0400
From: Dariush Azimi <dazimi@oradev.csis.csd.metrotor.on.ca>
Subject: How to sort nslookup result by IP
Message-Id: <3630E977.1644CAB2@oradev.csis.csd.metrotor.on.ca>
This is a multi-part message in MIME format.
--------------11B9EE1469AAFA7104490E69
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
When using nslookup I get a list of names with the associated IP address
and can sort the list by name using the sort command, but I would like
to sort the list by Ip address and have not been successful. Your help
is appreciated.
Thank you
Dariush.
ps. I direct the out put from nslookup to a file and that is how it
looks.
How ever I like to sort the list by Pi address.
This is a sample of the file.
Abraham 137.15.236.80
heath 137.15.236.165
ahead 137.15.209.50
alliance 137.15.236.133
amcgrath 137.15.187.11
ameisner 137.15.236.156
antoniae 137.15.236.100
barattam 137.15.175.12
beifortl 137.15.173.19
bemanuel 137.15.236.153
bgillies 137.15.236.109
bladesg 137.15.171.12
bwood 137.15.180.126
cainess 137.15.173.27
--------------11B9EE1469AAFA7104490E69
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Dariush Azimi
Content-Disposition: attachment; filename="vcard.vcf"
begin: vcard
fn: Dariush Azimi
n: Azimi;Dariush
email;internet: dazimi@oradev.csis.csd.metrotor.on.ca
title: Network Admin/DBA
note;quoted-printable:I could also be reached at =
=0D=0A=
dazimi@yahoo.com or=0D=0A=
Azimi@idirect.com
x-mozilla-cpt: ;0
x-mozilla-html: FALSE
version: 2.1
end: vcard
--------------11B9EE1469AAFA7104490E69--
------------------------------
Date: 23 Oct 1998 16:45:43 -0400
From: Uri Guttman <uri@fastengines.com>
To: Dariush Azimi <dazimi@oradev.csis.csd.metrotor.on.ca>
Subject: Re: How to sort nslookup result by IP
Message-Id: <sar90i7knwo.fsf@camel.fastserv.com>
>>>>> "DA" == Dariush Azimi <dazimi@oradev.csis.csd.metrotor.on.ca> writes:
DA> This is a multi-part message in MIME format.
DA> --------------11B9EE1469AAFA7104490E69 Content-Type: text/plain;
DA> charset=us-ascii Content-Transfer-Encoding: 7bit
don't post plain text in mime. it is a waste of pixels.
DA> When using nslookup I get a list of names with the associated IP
DA> address and can sort the list by name using the sort command, but
DA> I would like to sort the list by Ip address and have not been
DA> successful. Your help is appreciated.
this has been covered recently by several threads. check dejanews to
find them. look for 'sort' and 'IP' and you should get them.
DA> --------------11B9EE1469AAFA7104490E69 Content-Type: text/x-vcard;
don't post vcards. they are a bigger waste of pixels.
hth,
uri
--
Uri Guttman Fast Engines -- The Leader in Fast CGI Technology
uri@fastengines.com http://www.fastengines.com
------------------------------
Date: Fri, 23 Oct 1998 20:53:11 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Locking files under windows 98
Message-Id: <F1Ason.BEo@world.std.com>
Tom Phoenix <rootbeer@teleport.com> writes:
>On Thu, 22 Oct 1998, E Unpingco wrote:
>> Has anyone figured out how to lock files under windows 98?
>If it can be done at all, it should be done transparently by Perl's
>built-in flock function.
Occationally I talk out loud about the possiblity of using named
semaphores to simulate locks under Windows 98 (although when I started
talking about it I was referring to Windows 95) but I never get around
to implementing it.
It wouldn't help with concurrent access from other programs (which
would know nothing about the "perl" locks) but would prevent it from
identical copies of the same program and from any other perl program.
Can anyone wee ay problems with this approach?
--
Andrew Langmead
------------------------------
Date: 23 Oct 1998 19:11:46 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: MSQL dump from PERL script
Message-Id: <70qkdi$djm$1@news.NERO.NET>
In article <3630bc8b.0@diana.idirect.com>,
Edgar Sigal <edgarnospam@insidewire.com> wrote:
>I need help in creating a script which will call the standard msql dump
>program on my server, to output to a text file which I will then be able to
>retrive with ftp.
>
>Any help is greatly appreciated
Ummm, the standard msql dump program already outputs a text file which
you can retrieve with ftp. Which part of the process do you think needs
to be replaced by a perl script?
------------------------------
Date: 23 Oct 1998 14:24:01 -0500
From: tye@fohnix.metronet.com (Tye McQueen)
Subject: Re: New Module: File::Finder -- OO version of File::Find
Message-Id: <70ql4h$snl@fohnix.metronet.com>
ilya@math.ohio-state.edu (Ilya Zakharevich) writes:
) and an extra flag to *always* stat() the file.
[This is a reference to empty directories having a link count
of 2 and the associated speed optimization, correct?]
Always doing stat() should be the default behavior. File::Finder
should work correctly by default and do dangerous optimizations
that only work on certain types of file systems on certain
operating systems if the user or installer is smart enough to
figure out that the optimization will work and the speed
improvement is necessary.
Having a way to make the optimized behavior default for certain
installations where the installer knows that any of several
file systems that don't work that way will never be used should
probably be provided since some people have gotten used to this.
But I don't think it should be assumed just because you are
installing to a Unix system, for example. There are just too
many exceptions. And the myth that you should almost always be
doing this optimization needs to be dispelled, I'm sick of
getting burned by it in several different modules.
--
Tye McQueen Nothing is obvious unless you are overlooking something
http://www.metronet.com/~tye/ (scripts, links, nothing fancy)
------------------------------
Date: 23 Oct 1998 13:18:04 -0600
From: snowhare@xmission.xmission.com (Snowhare)
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <70qkpc$2gu$1@xmission.xmission.com>
Nothing above this line is part of the signed message.
In article <u90i7jjdp.fsf@jimbosntserver.soundimages.co.uk>,
Jim Brewer <jimbo@soundimages.co.uk> wrote:
>rsholmes@rodan.syr.edu (Richard S. Holmes) writes:
>
>>
>> TFM was part of the problem, not the solution.
>>
>
>Sorry, you are wrong. The documentation provided with Perl 5.004 is
>very clear about the state of time. Regardless the colour of one's
>Camel.
[snip]
The pink Camel applied to Perl4. Not Perl5.
Benjamin Franz
Version: 2.6.2
iQCVAwUBNjDWZejpikN3V52xAQGkWwP6Ak4LgAAwwifji6V2iB0Rwvb6rMOxYXeG
bCSxBLxIQlZojI6hSWyV58R1BWiDS72KCfviVqHYVYpDG7qviqXpFcYjKXhngfxf
71GNbWWP1ytHCJM0CEsgWol+rs1lCXxsR5uJeh8+wbBwalK8XGcquKAtEcXqL/Az
s9lxrH3/7+A=
=+NyA
-----END PGP SIGNATURE-----
------------------------------
Date: Fri, 23 Oct 1998 14:38:43 -0500
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <3630DB43.7DB91E08@mindspring.com>
Lloyd Zusman wrote:
>
> Randal Schwartz <merlyn@stonehenge.com> writes:
>
> > >>>>> "finsol" == finsol <finsol@ts.co.nz> writes:
> >
> > finsol> In your expert opinion: Would you recommend that Perl
> > finsol> applications be checked for Year 2000 problems?
> >
> > Only in the same sense that *all* applications be check for such
> > problems. Do not single out "Perl" being the fault. There is *no*
> > language that is immune from potential Y2K problems.
>
> I think that you are mis-interpreting Jocelyn Amon's (finsol's)
> statement. I don't see anywhere in her quoted statement, nor in any
> of the other statements she made in the post you are quoting or any of
> her other previous posts, where she is trying to single out Perl, or
> even trying to assign fault or blame.
>
> I believe that a fair and accurate rephrasing of her question that you
> quoted here would be this: "In your expert opinion, are Perl programs
> *less* prone to Y2K problems than programs written in other languages,
> and would you therefore recommend that people spend any *less* time
> and effort checking their Perl applications for Y2K problems than
> applications in any other languages?"
>
> I trust that your answer would be "No" to both of these questions, and
> in giving this answer, I believe that you would be in no way trying to
> single out Perl or to assign any kind of fault or blame ... no more
> than Jocelyn Amon appears to be doing in her posts.
>
> > So, delete the word "Perl" there, and I'll agree with you.
>
> Given your apparent mis-interpretation of Jocelyn Anon's intent, it
> looks to me like you and she are already in agreement, without her
> having to change any of her wording.
>
Actually, I agree with you about her intent (giving her the benefit of
the doubt), but there are at least a couple of places where she lapses
into blaming the language itself (not singling out Perl over C, mind
you). Reread the article again carefully, or look at my posting of
Wednesday (hmmm, that has an end-of-week problem, doesn't it?) in this
thread.
------------------------------
Date: 23 Oct 1998 14:48:23 -0500
From: tye@fohnix.metronet.com (Tye McQueen)
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <70qmi7$45t@fohnix.metronet.com>
) See ye here Abigail's writings:
) >Craig Berry (cberry@cinenet.net) wrote on MDCCCLXXVII September MCMXCIII
) >++ 'Fix' is the wrong term. Perl's localtime() is just a wrapper for C/Unix
) >++ localtime(), which has, throughout history, returned year-1900.
) >
) >I agree with Gisle. The person who decided the tm struct should contain
) >the year - 1900 made a very bad decision, and it would have great if
) >Larry had "fixed" it for Perl.
monson@tri.sbc.com (Steve Monson) writes:
) I see nothing wrong with year-1900. To get the proper year, just always
) add 1900.
You should read "The Design of Everyday Things" (or one of several
other titles it has been published under), for example, and learn
how if your design affords certain misuses, then you shouldn't be
surprised when lots of people end up misusing you stuff that way.
Using "year - 1900" gives a strong temptation to use things like
"%.2d" with it (or even "19%.2d"). It makes stupid code more likely.
) Not even a problem when comparing dates, unless you go back
) before 1900.
Gee, you even found more bugs with this design yourself. Since
Perl runs on more than just certain flavors of Unix, realizing
that C's localtime() made a mistake and "fixing" how the year was
returned to be more general would have been nice.
And the month should be between 1 and 12 as well.
--
Tye McQueen Nothing is obvious unless you are overlooking something
http://www.metronet.com/~tye/ (scripts, links, nothing fancy)
------------------------------
Date: Fri, 23 Oct 1998 20:22:53 GMT
From: hex@voicenet.com (Matt Knecht)
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <xA5Y1.1$1g4.186028@news2.voicenet.com>
Tye McQueen <tye@fohnix.metronet.com> wrote:
>And the month should be between 1 and 12 as well.
0 offset makes it easier to map to arrays, IMHO. Unless you also think
Perl should be made 'easier' by starting arrays off at 1, and not 0.
--
Matt Knecht - <hex@voicenet.com>
------------------------------
Date: 23 Oct 1998 16:38:37 -0400
From: Uri Guttman <uri@fastengines.com>
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <sarbtn3ko8i.fsf@camel.fastserv.com>
>>>>> "MK" == Matt Knecht <hex@voicenet.com> writes:
MK> Tye McQueen <tye@fohnix.metronet.com> wrote:
>> And the month should be between 1 and 12 as well.
MK> 0 offset makes it easier to map to arrays, IMHO. Unless you also
MK> think Perl should be made 'easier' by starting arrays off at 1,
MK> and not 0.
and as this thread has mentioned, the origins in C and indexing into
arrays of strings, made months starting at 0 a good idea.
and for outputing a date you should use POSIX::strftime which will do almost
any format you want, so who cares about localtime for most cases.
uri
--
Uri Guttman Fast Engines -- The Leader in Fast CGI Technology
uri@fastengines.com http://www.fastengines.com
------------------------------
Date: 23 Oct 1998 14:46:57 -0600
From: snowhare@xmission.xmission.com (Snowhare)
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <70qq01$m2q$1@xmission.xmission.com>
Nothing above this line is part of the signed message.
In article <xA5Y1.1$1g4.186028@news2.voicenet.com>,
Matt Knecht <hex@voicenet.com> wrote:
>Tye McQueen <tye@fohnix.metronet.com> wrote:
>>And the month should be between 1 and 12 as well.
>
>0 offset makes it easier to map to arrays, IMHO. Unless you also think
>Perl should be made 'easier' by starting arrays off at 1, and not 0.
It comes out in the wash. Either you require offset by one to 'correct'
'0..11' to '1..12' for users or you require offset by minus one to
'correct' '1..12' to '0..11' for array referencing. I use whichever is
convienent at the time. Of course, you could always fiddle with '$[' if
you are into self-inflicted pain....
Benjamin Franz
Version: 2.6.2
iQCVAwUBNjDrO+jpikN3V52xAQFowwP/SNowmBhaUJp0Z5SR7egJ103S8F7BXHMK
LvDgu6pfX8A1GLzAkxKYue4SzheRBMt5JhOieNE1BFpf9fxZs4GzAKOe+W5zthps
vsuKgRC6xJeA+vcvC4KKN5nPjD2fCD46gz/0azYeXzFGulp98n+/rGqwCeph8eUs
RzOZh/PEfc8=
=DDgM
-----END PGP SIGNATURE-----
------------------------------
Date: Fri, 23 Oct 1998 13:42:52 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <MPG.109a8a24bfb1dc45989836@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and a copy mailed.]
In article <70qmi7$45t@fohnix.metronet.com> on 23 Oct 1998 14:48:23 -
0500, Tye McQueen <tye@fohnix.metronet.com> says...
...
> Gee, you even found more bugs with this design yourself. Since
> Perl runs on more than just certain flavors of Unix, realizing
> that C's localtime() made a mistake and "fixing" how the year was
> returned to be more general would have been nice.
>
> And the month should be between 1 and 12 as well.
<RANT>
Then the flames would have been -- quite justifiably, IMO -- why Perl
had the effrontery to adopt the names, calling conventions, and data
structure used by functions specified by the ISO/ANSI C Standard, and
yet to tinker with (sorry, to "correct") a couple of the ranges, thereby
introducing great confusion and error potential for the poor souls who
still have to program in C or C++ as well as in the holy Perl.
Standards are never perfect, often because the specifications of the
base implementation are adopted as-is for backward compatiblity. This
particular specification is over two decades old, and the C Standards
Committee did not think the benefit of "correcting" it outweighed the
costs of redocumenting and reimplementing existing code that would have
to use the Standard Library in the future (i.e. "break existing code").
And the benefit of having the same -- slightly flawed -- interface
shared by several languages is invaluable.
To sum up in one sentence: Please give it a rest!
</RANT>
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 23 Oct 1998 16:54:46 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <70qqem$auj$1@monet.op.net>
In article <70qmi7$45t@fohnix.metronet.com>,
Tye McQueen <tye@fohnix.metronet.com> wrote:
>And the month should be between 1 and 12 as well.
Yeah, the month was a mistake too.
It would have been really easy for people to define their month name
arrays with an extra dummy element 0 on the front:
@month =qw(Bad Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
Certainly it would have been a lot easier than explaining to everyone
why it emits `7' in August.
Whoever designed the struct tm library really made a botch of it.
If they had been either fifty percent cleverer or fifty percent less
clever, it would have been a lot better than it is now.
------------------------------
Date: Fri, 23 Oct 1998 19:45:38 GMT
From: scheiner@my-dejanews.com
Subject: Perl unix to nt port
Message-Id: <70qmd2$v7$1@nnrp1.dejanews.com>
This works on unix but not NT. Any suggestions?
sub preview_card {
$htmlpath = path goes here;
open(TFILE, "$htmlpath/$postcard\pre.html");
while (<TFILE>) {
s#"\.\./\.\./images/#"/images/#g;
s#"\.\./images/#"/spice/images/#g;
s#XXMESSAGE#$message#;
print;
}
close(TFILE);
all variables come from other parts of the script. I have some additional
text that is appended after the file. When I run this on unix, the file
appears with the extra text appended and everything is fine. On NT, all I
get is the extra text.
Thanks to anyone who helps me on this.
scheiner
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Fri, 23 Oct 1998 13:51:15 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Perl unix to nt port
Message-Id: <MPG.109a8c1fb8fcda15989837@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and a copy mailed.]
In article <70qmd2$v7$1@nnrp1.dejanews.com> on Fri, 23 Oct 1998 19:45:38
GMT, scheiner@my-dejanews.com <scheiner@my-dejanews.com> says...
> This works on unix but not NT. Any suggestions?
> sub preview_card {
> $htmlpath = path goes here;
>
> open(TFILE, "$htmlpath/$postcard\pre.html");
It is unlikely that the last element in the path is the concatenation of
the value of $postcard and the string 'pre.html' -- but that's what this
code says. Your processing of TFILE didn't occur because you failed to
open the file, and you didn't know that because you forgot to check the
value returned by 'open'. For shame!
Swing the backslash around to a forward slash, and ALWAYS check the
result of 'open'. TomP will tell you that soon, if he is here today.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 23 Oct 1998 20:22:48 GMT
From: Bill Walker <bw@cs3.ecok.EDU>
Subject: Re: Perl, dynamic loading, SCO OS 5
Message-Id: <70qoio$faf$1@sunhub-tulsa.onenet.net>
In comp.unix.sco.misc Knute Snortum <knutens@masi.com> wrote:
> This is interesting. It seems that even the Skunkware version of Perl has
> problems at /lib/odbm. When I do a 'make test' I get a core dump at this
> test (see thread Perl 5.005_02, make test fails at /lib/odbm). Does this
> function work on OS5?
> [huge snip]
> >lib/ndbm............ok
> >lib/odbm............Bad free() ignored at lib/odbm.t line 63.
> >Bad free() ignored at (eval 4) line 2.
> >ok
> >lib/opcode..........ok
Hmm. Mine worked fine on both OSR5.0.2 and OSR5.0.4 .
Did you try the config.sh I posted ? I statically linked ALL
the *DBM stuff.
73 de Bill W5GFE
------------------------------
Date: 23 Oct 1998 16:52:45 -0400
From: ma@panix.com (malgosia askanas)
Subject: Printing large integers readably
Message-Id: <70qqat$8f1@panix2.panix.com>
What is the simplest way of getting Perl to print out large integers
with commas between every group of 3 digits (e.g. "1,356,400")?
Thanks in advance for your help.
-malgosia
------------------------------
Date: Fri, 23 Oct 1998 18:58:02 GMT
From: boson@earthlink.net (Boson)
Subject: reference to array
Message-Id: <3630d032.268946782@news.earthlink.net>
Hi,
I was wondering of there is another (better) way to grab the value of
the last element for an anonymous array. What I have is this:
@{$aryref}[$#{$aryref}]
Thanks in advance.
Boson
------------------------------
Date: Fri, 23 Oct 1998 19:24:09 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Re: reference to array
Message-Id: <tJ4Y1.3300$fS.10252901@news.itd.umich.edu>
In article <3630d032.268946782@news.earthlink.net>,
Boson <boson@earthlink.net> wrote:
>I was wondering of there is another (better) way to grab the value of
>the last element for an anonymous array. What I have is this:
>@{$aryref}[$#{$aryref}]
$aryref->[-1];
--
Sean McAfee | GS d->-- s+++: a26 C++ US+++$ P+++ L++ E- W+ N++ |
| K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
| tv+ b++ DI++ D+ G e++>++++ h- r y+>++** | umich.edu
------------------------------
Date: 23 Oct 1998 15:23:39 -0400
From: Uri Guttman <uri@fastengines.com>
To: boson@earthlink.net (Boson)
Subject: Re: reference to array
Message-Id: <sarg1cfkrpg.fsf@camel.fastserv.com>
>>>>> "B" == Boson <boson@earthlink.net> writes:
B> Hi, I was wondering of there is another (better) way to grab the
B> value of the last element for an anonymous array. What I have is
B> this:
B> @{$aryref}[$#{$aryref}]
you can index from the end of any array (anon or real) with negative
numbers. so the last element is @array[-1]. i leave it as an very easy
exercise to make that work for an anon array.
uri
--
Uri Guttman Fast Engines -- The Leader in Fast CGI Technology
uri@fastengines.com http://www.fastengines.com
------------------------------
Date: 23 Oct 1998 15:27:05 -0400
From: Uri Guttman <uri@fastengines.com>
Subject: Re: reference to array
Message-Id: <sard87jkrjq.fsf@camel.fastserv.com>
>>>>> "UG" == Uri Guttman <uri@fastengines.com> writes:
>>>>> "B" == Boson <boson@earthlink.net> writes:
B> Hi, I was wondering of there is another (better) way to grab the
B> value of the last element for an anonymous array. What I have is
B> this:
B> @{$aryref}[$#{$aryref}]
UG> you can index from the end of any array (anon or real) with
UG> negative numbers. so the last element is @array[-1]. i leave it as
UG> an very easy exercise to make that work for an anon array.
me brain dead. it is friday. the phase of the moon bothering me. it
should be $array[-1]. somedays i just can't type what i mean.
uri
--
Uri Guttman Fast Engines -- The Leader in Fast CGI Technology
uri@fastengines.com http://www.fastengines.com
------------------------------
Date: Fri, 23 Oct 1998 20:43:32 +0200
From: Eckard Brauer <e.brauer@intershop.de>
Subject: Socket Problem again
Message-Id: <3630CE54.2AAF6D99@intershop.de>
Hello again,
I wrote:
...
> There has been a problem with using sockets in a sendmail script
> function a few days (weeks) back. I can't remember the exact point, but
> we 've had a similar problem with the nearly same script.
...
> different platforms (Reliant-UNIX/svr4). Seems that at least the perl I
> built has a side effect of closingone direction of bidirectional
> channels with 'select(FILEHANDLE)' in some contexts, at least when
> assuming that the response of the mail server is held in an receive
> buffer _before_ 'select' is evaluated.
>
...
It looks to me that the Socket implementation of different SysV systems
is not what perl expects, I found a similar problem in a main routine of
a larger application, where a socked is reopened as STDIN and STDOUT:
...
($addr = accept(NS, S_IN)) || die "accept: $!";
close(STDIN);
close(STDOUT);
open(STDIN, "<&NS") || die "ISSRV: Can't dup NS to STDIN: $!\n";
open(STDOUT, ">&NS") || die "ISSRV: Can't dup NS to STDOUT: $!\n";
select(STDOUT); $| = 0;
while (<STDIN>) {
...
After that, the socket is read from (ok) and a few statements later
(with no further IO between) is written to (print $HTML_OK_MESSAGE;).
Observing "$!" immediate after this I got "Invalid argument" as before
in the sendmail function, showing me, that the socked is wrong.
Is there any help available?
Eckard
------------------------------
Date: Fri, 23 Oct 1998 13:39:56 -0700
From: Sean Scannell <sean@select-systems.com>
Subject: Storing path info for access by many scripts
Message-Id: <3630E99B.1E5A73E9@select-systems.com>
Ok, I've missed a basic step somehow. To access a few strings like
$home_dir = '/my_app/';
$read_dir = '/my_app/read/';
$mailprog = '/usr/lib/sendmail/';
from many scripts, I created a file Env_var.pm that contains
package Env_var;
$home_dir = '/my_app/';
$read_dir = '/my_app/read/';
$mailprog = '/usr/lib/sendmail/';
In my script I write
use Env_var;
print $home_dir;
Nothing prints. Do I need to install the module using Makemaker, or is
there an easier way?
------------------------------
Date: Fri, 23 Oct 1998 20:56:54 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Re: Storing path info for access by many scripts
Message-Id: <q46Y1.3303$fS.10290636@news.itd.umich.edu>
In article <3630E99B.1E5A73E9@select-systems.com>,
Sean Scannell <sean@access-management.com> wrote:
>Ok, I've missed a basic step somehow. To access a few strings like
>$home_dir = '/my_app/';
>$read_dir = '/my_app/read/';
>$mailprog = '/usr/lib/sendmail/';
>from many scripts, I created a file Env_var.pm that contains
>package Env_var;
>$home_dir = '/my_app/';
>$read_dir = '/my_app/read/';
>$mailprog = '/usr/lib/sendmail/';
Since you're in package Env_var, you're really assigning to the variables
$Env_var::home_dir, $Env_var::read_dir, and $Env_var::mailprog.
>In my script I write
>use Env_var;
>print $home_dir;
Since you're (presumably) in package main here, you're printing the
contents of variable $main::home_dir, which is different than variable
$Env_var::home_dir (it's in a different symbol table).
>Nothing prints. Do I need to install the module using Makemaker, or is
>there an easier way?
Yes. You need to explicitly export your variables. This is most easily
accomplished with the Exporter module. Put the following lines after your
"package Env_var;" line:
use Exporter;
@ISA = 'Exporter';
@EXPORT = qw/$home_dir $read_dir $mailprog/;
The Exporter module gives your module an "import" method (called by "use")
which aliases symbols in the calling package to symbols in the Env_var
package; in this case, it essentially does the equivalent of this:
*main::home_dir = \$Env_var::home_dir;
*main::read_dir = \$Env_var::read_dir;
*main::mailprog = \$Env_var::mailprog;
See the perldata manpage if you're unfamiliar with this syntax. It would
also certainly be worth your while to read "perldoc Exporter".
--
Sean McAfee | GS d->-- s+++: a26 C++ US+++$ P+++ L++ E- W+ N++ |
| K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
| tv+ b++ DI++ D+ G e++>++++ h- r y+>++** | umich.edu
------------------------------
Date: 23 Oct 1998 13:58:40 -0600
From: snowhare@xmission.xmission.com (Snowhare)
Subject: Re: Who can help me write full-text search engine in Perl with indexing
Message-Id: <70qn5g$ba5$1@xmission.xmission.com>
Nothing above this line is part of the signed message.
In article <362e1b18.606983215@nntp.cts.com>,
Danny Groppo <gosdpads@yahoo.com> wrote:
>Snowhare,
>
>Would you please repost the search engine code. Towards the end of
>the message, it was cut off. Thank you!
>
Hmmm....It posted to my server correctly (I just checked to make sure it
got there ok) - but checking DejaNews it appears somewhere in transmission
someone chopped off part of it.
Ok. Rather than repost it - here is a URL for it:
<URL:http://www.nihongo.org/snowhare/utilities/jcrawler/Inverse-Map.txt>
Benjamin Franz
Version: 2.6.2
iQCVAwUBNjDf6ujpikN3V52xAQF/qwQAgIj4qSI7hGm2icQZz9OnWxxqnJAltMpK
4iWP53sp/4MrweBX+mC3ZmOEC2TE4HwmFhIH1T5mkMhDd/AE6gUfFqnE5ke9i4mn
hpvCtqxMbedRayb+/LdqxTe/3WGveIuP/XJzOXwiAAVa4j382/EsuI1saBvwWzR/
ltfyqndRL/A=
=LQdv
-----END PGP SIGNATURE-----
------------------------------
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 4056
**************************************