[12236] in Perl-Users-Digest
Perl-Users Digest, Issue: 5836 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun May 30 19:07:22 1999
Date: Sun, 30 May 99 16:00:18 -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 Sun, 30 May 1999 Volume: 8 Number: 5836
Today's topics:
"Sticking" together bitmaps on hit counters. <thurley@globalnet.co.uk>
Re: "Sticking" together bitmaps on hit counters. <rootbeer@redcat.com>
Re: $^O and all types? <cassell@mail.cor.epa.gov>
4-arg select(), STDIN, and Activestate/Win32 (Aaron Elkiss)
Anyone know where to get (buy) custom made pearl script (xxx)
Re: Couple of basic questions from newbie <bill@fccj.org>
Re: Couple of basic questions from newbie (Larry Rosler)
Downloading large files with LWP weixian_shen@my-deja.com
Expire a Page <splinter@monmouth.com>
Re: Expire a Page <rootbeer@redcat.com>
Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Pe <y2k@uswest.net.NO$PAM>
Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Pe (Malcolm Ray)
Re: Help: About Apache and Perl weixian_shen@my-deja.com
Re: How do I sort unique items from a sorted array? <rick.delaney@home.com>
Re: how to upload file from the form? <cassell@mail.cor.epa.gov>
Re: how to upload file from the form? <bill@fccj.org>
Re: Im not asking for much <eweiss@winchendon.com>
Re: Measuring space on a share <blazer@mail.nevalink.ru>
Nesting an if inside a for each loop <jb4mt@hotmail.com>
Re: Nesting an if inside a for each loop (Graham Ashton)
Re: Nesting an if inside a for each loop <rootbeer@redcat.com>
Re: REMOTE_USER - How come I can't see it? <cassell@mail.cor.epa.gov>
Re: Slow, or looping? (Ilya Zakharevich)
Re: Uploading image files.. <kinmich1@lycoming.edu>
Re: Y2K infected Perl code (Frank Ney)
Re: Y2K infected Perl code (Malcolm Ray)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 30 May 1999 23:01:35 +0100
From: "Thurley" <thurley@globalnet.co.uk>
Subject: "Sticking" together bitmaps on hit counters.
Message-Id: <7iscjd$gkp$1@gxsn.com>
I want to create a graphical hit counter, but I cannot figure out how to
stick different bitmaps together to make one long number. Any help would be
apreciated.
James.
------------------------------
Date: Sun, 30 May 1999 15:19:21 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: "Sticking" together bitmaps on hit counters.
Message-Id: <Pine.GSO.4.02A.9905301518360.15468-100000@user2.teleport.com>
On Sun, 30 May 1999, Thurley wrote:
> I want to create a graphical hit counter, but I cannot figure out how
> to stick different bitmaps together to make one long number. Any help
> would be apreciated.
There are oodles of hit counters out there; you could get one and see what
it does. But the GD module from CPAN will be handy if you wish to create
graphics from within Perl. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 30 May 1999 14:37:09 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: $^O and all types?
Message-Id: <3751AF85.66B79163@mail.cor.epa.gov>
Dan Sugalski wrote:
>
> $Richy Rich$ <rich_guy@hotmail.com> wrote:
> : i'm trying to make my scripts more portable, and also make it easier for
> : people that use them and set them up. this of course, would involve
> : knowing what OS they are using. i need to check it to know if (depending
> : on the OS) i can use flock, do forking, etc. and what will and will not
> : work with windows that will work with unix, and what will and will not
> : work with certain versions of certain OS's. is the $^O the only thing i
> : can check this with?
> : [more stuff snipped...]
>
> The Config module is your friend here. perldoc Config and be enlightened.
But you'll need to do some additional checking in a few cases.
Since ActiveState Perl is pre-built, you can't tell from its
%Config whether you're on NT or not. You'll want to look up
the Win32::IsWinNT() function.. among others.
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Sun, 30 May 1999 21:02:30 GMT
From: aelkissNOSPAM@bcplNOSPAM.net (Aaron Elkiss)
Subject: 4-arg select(), STDIN, and Activestate/Win32
Message-Id: <slrn7l39qh.707.aelkissNOSPAM@mail.bcpl.net>
Keywords: select activestate win32 bug issue stdin STDIN
Has anybody noticed that using the 4-argument select on STDIN doesn't
seem to work properly under ActiveState Perl for win32? (ActiveState
build 515, version 5.005_03)
Here is a little script I used to test:
#!/usr/local/bin/perl
$rin = "";
vec($rin, fileno(STDIN), 1) = 1;
print "Selecting on STDIN, nonblocking\n";
if ( select($rin, undef, undef, 0) ) {
print "Select returned 1.\n"
};
print "select on STDIN, blocking\n";
vec($rin, fileno(STDIN), 1) = 1;
select($rin, undef, undef, undef);
Under Win32, this script returns:
C:\>perl c:\pigirc\select.pl
Selecting on STDIN, nonblocking
Select returned 1.
select on STDIN, blocking
C:\>
without blocking at all.
Clearly not what one was expecting. As a side note, if you try to read
from STDIN, it blocks until you type something and hit return as
expected.
Under perl from djgpp v2 ( perl 5.004_02), the script functions as expected.
I:\djgpp\BIN>perl c:\pigirc\select.pl
Selecting on STDIN, nonblocking
select on STDIN, blocking
I:\djgpp\BIN>jsadkfjasdkf
The script blocks until you type the "j", at which time it returns.
Same deal with Solaris, perl 5.002, although you have to press enter
before it returns.
[aelkiss@mail aelkiss]$ perl select.pl
Selecting on STDIN, nonblocking
select on STDIN, blocking
jfhgj
[aelkiss@mail aelkiss]$ jfhgj
Also does the same thing with Linux, perl 5.005 (so it's not a 5.005
issue)
Anyway, 1) Is this a recognized issue? The ActiveState FAQ doesn't
mention anything about select() not working as expected.
2) Is there a workaround?
-a!
------------------------------
Date: Sun, 30 May 1999 22:40:55 GMT
From: home@myhouse.com (xxx)
Subject: Anyone know where to get (buy) custom made pearl scripts?
Message-Id: <3751be0e.71934017@news.mindspring.com>
------------------------------
Date: Sun, 30 May 1999 16:58:30 -0400
From: "Bill Jones" <bill@fccj.org>
Subject: Re: Couple of basic questions from newbie
Message-Id: <3751a666.0@usenet.fccj.cc.fl.us>
In article <375185b3.3132021@fleece.argonet.co.uk>, marshal@marshal.co.uk
wrote:
> OK - just starting and this will be a long row to hoe. One specific
> and one general question.
>
> 1) I note that the perl print statment (command? Method?) hates having
> double quotes in it - so far I have always had to remove them to make
> the script work. BUT HTML tags often require attributes in quotes. Is
> the solution an escape character of some sort or something I've
> missed?
That's not true; HERE DOCUMENTS work great:
print << _I_Dont_Hate_Doubles;
"This is a test of the emergency broadcasting system! "
"I love Double Quotes, and "
'I love singles, too!'
_I_Dont_Hate_Double
>
> 2) Can I use perl to create, open, write to, up-date and delete files
> on the server? No need for explaination of how - just that the product
> I'm aiming at will need that (or some other solution) and I want to
> know if I'm barking up the right tree.
>
> Marshal
Is this server FTP aware? Does the 'solution' you have in mind
have access/authority to delete files on the
'server' as you call it?
If true, then yes, perl can. You will find that perl is
only limited by your imagination.
/^HTH$/
-Sneex- :]
______________________________________________________________________
Bill Jones Data Security Specialist http://www.fccj.org/cgi/mail?dss
Need to get started in Perl? See http://jacksonville.pm.org/Letter.cgi
------------------------------
Date: Sun, 30 May 1999 14:29:09 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Couple of basic questions from newbie
Message-Id: <MPG.11bb4d6cc8dddd62989b36@nntp.hpl.hp.com>
In article <Pine.GSO.4.02A.9905301238280.20230-
100000@user2.teleport.com> on Sun, 30 May 1999 12:48:49 -0700, Tom
Phoenix <rootbeer@redcat.com> says...
...
> Another way is to use "generalized" quote marks. These look like qq// or
> qq() or qq{}, and let you choose the punctuation mark to use, so long as
> you use the corresponding one to finish the quote. Of course, you should
> choose something you won't be needing to use within the string, or you'll
> need to backwhack _that_ character!
>
> print qq{I say, "This is better yet", don't you agree?\n};
print qq{I know that you know this full well, Tom, but your last
sentence about backwhacking the quoting character doesn't quite jibe
with your example, which might include interpolating a hash slice
$hash{whatever}, or even just random {curly brackets} as long as they
come in proper pairs, not like these two: \} \{ .\n"};
PS: Welcome back to posting here. You were missed!
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Sun, 30 May 1999 21:47:53 GMT
From: weixian_shen@my-deja.com
Subject: Downloading large files with LWP
Message-Id: <7isbm9$bhq$1@nnrp1.deja.com>
Hi,
I need to write a robot script that download huge files (might be
well over 20M). Could LWP library handle that? It seems that LWP
functions stores the content of a downloaded file into a scalar
variable, which is certainly not suited for this situation. I need to
be able to resume if the connection times out. Is there a module out
there that would do it? Thanks for your suggestions.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Sun, 30 May 1999 17:34:00 -0400
From: "Matt" <splinter@monmouth.com>
Subject: Expire a Page
Message-Id: <7isavd$8is$1@news.monmouth.com>
Objective: I want to make a page expire after x minutes or seconds.
Details: I have to create a new page, write HTML to it, send the user
there, then after the user is done with that page the page would expire so
no one could go back to it. How would this be done?
------------------------------
Date: Sun, 30 May 1999 15:17:23 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Expire a Page
Message-Id: <Pine.GSO.4.02A.9905301516250.15468-100000@user2.teleport.com>
On Sun, 30 May 1999, Matt wrote:
> Objective: I want to make a page expire after x minutes or seconds.
It sounds as if you want a browser, server, or cache to do something. I
recommend you check the docs, FAQs, and newsgroups about browsers,
servers, or caches. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 30 May 1999 15:30:36 -0500
From: "D. Scott Secor - Millennial Infarction Mitigator" <y2k@uswest.net.NO$PAM>
Subject: Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Perl Y2K compliant?
Message-Id: <vfh43.4076$Np1.214718@news.uswest.net>
Marc Haber <Marc.Haber-usenet@gmx.de> wrote in message
news:7ir0nq$a58$1@news.rz.uni-karlsruhe.de...
> torek@elf.bsdi.com (Chris Torek) wrote:
> >Again, this is entirely wrong. The *languages* do not *contain*
> >the bugs. The languages -- whether COBOL, assembly, Perl, C, or
> >English -- are merely the medium in which people write faulty
> >messages.
>
> While fully agreeing with you, I'd like to re-word your statement just
> again: It isn't English's fault that it's possible to say in correct
> English that MVS is a programming language. Asking to modify English
> so that such errors are prevented is simply ridiculous.
MVS is a "programming language"? That ought to come as a real shock to IBM.
;-)
Ciao,
--
D. Scott Secor, Year 2000 Institute & Board of Inquiry, Mpls., MN USA
Might your BIOS/RTC be non-compliant? Need DOS/NOS patches?
Y2k project tools & templates? Try http://y2k.board.org/g_docs.html
------------------------------
Date: 30 May 1999 22:29:44 GMT
From: M.Ray@ulcc.ac.uk (Malcolm Ray)
Subject: Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Perl Y2K compliant?
Message-Id: <slrn7l3euo.8qd.M.Ray@carlova.ulcc.ac.uk>
On Sat, 29 May 1999 20:21:49 GMT, finsol@ts.co.nz <finsol@ts.co.nz> wrote:
>In the same section of my article I also included CICS, MVS and
>Javascript - all of which could be disputed as being a programming
>language. For the purposes of the article, in which I tried to avoid as
>much jargon as possible, it was convenient to describe them as
>programming languages, as programmers use them for
>instructing computers i.e. programming. My point was to draw attention
>to these languages as having a problem - which they do. You are only
>arguing semantics because you are unable to sucessfully argue against my
>main point which is that the Perl programming language is Y2K booby
>trapped.
>
>You would do the Perl community more credit by working on Y2K awareness,
>not clouding the issue unecessarily.
Other people have argued against your imprecision using analogies,
but since this hasn't got through to you, I'll make the point more
directly. In the context of Y2K, it is important to distinguish
between different kinds of entities - programming languages, operating
systems, applications, APIs etc - because they play different roles
in the organisation, with consequent differences in how they should be
verified and fixed. If I know that a particular version of operating
system is not Y2K-compliant, I may face the task of installing numerous
time-consuming patches to many systems, or even upgrading the OS,
which implies a significant amount of disruption in downtime. If,
on the other hand, a particular language's RTL has functions which are
open to Y2K misuse, then this obviously only impacts those applications
written in that language, often running on a small number of systems,
and we can focus our testing on those and hopefully make any necessary
changes with little or no impact on users.
You see, accurate taxonomy *does* make an important difference
when discussing software. You've already seen that blurring the
boundaries doesn't play well with the techies who actually do the Y2K
testing and fixing. Since you persist in defending this hand-waving
inaccuracy, I presume you think your audience lies elsewhere and is
less technical, possibly further up the management chain. But I'd
suggest that you're doing them a disservice, too. They're already
surrounded by FUD. If they're not already on top of the problem,
what they need is clarity. It's not particularly difficult to explain
the difference between an operating system and a programming language
to a non-programmer, and I can't understand why you wouldn't try.
After all, you don't want to *increase* confusion about Y2K, do you?
--
Malcolm Ray University of London Computer Centre
------------------------------
Date: Sun, 30 May 1999 21:31:32 GMT
From: weixian_shen@my-deja.com
Subject: Re: Help: About Apache and Perl
Message-Id: <7isank$b1o$1@nnrp1.deja.com>
Thanks, Jonathan. I will try comp.infosystems.www.authoring.cgi
In article <7ioq7a$2i5$1@gellyfish.btinternet.com>,
Jonathan Stowe <gellyfish@gellyfish.com> wrote:
> [ comp.lang.perl removed as it dont exist, comp.lang.perl.modules
> removed because this hasnt anything to do with modules ]
>
> In comp.lang.perl.misc weixian_shen@my-deja.com wrote:
> > Hi,
> > I am writing a Perl CGI that needs to detect if the users has
> > clicked the "STOP" button before the CGI finishes. I thought
> > apache server will send the CGI script a SIGINT or something of
> > that kind when user press the STOP button, but it didn't work.
>
> It will almost certaily be too late as the client will have closed its
> end of the socket but I think that the program will get a SIGPIPE.
> If you are worried about transactions being completed however you
might
> need to do some checkpointing in your program.
>
> Almost certainly you will want to ask this question in a group such
as:
>
> comp.infosystems.www.authoring.cgi
>
> Where people are more (avowedly) knowledgeable on thes matters.
>
> /J\
> --
> Jonathan Stowe <jns@gellyfish.com>
> Some of your questions answered:
> <URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
> Hastings:
<URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Sun, 30 May 1999 15:41:21 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: How do I sort unique items from a sorted array?
Message-Id: <37515BD0.E4D4EA12@home.com>
[posted & mailed]
AEF wrote:
>
> Tom Phoenix <rootbeer@redcat.com> wrote in message
> news:Pine.GSO.4.02A.9905292130460.13014-100000@user2.teleport.com...
> >
> > print "Category: $category\n"
> > unless $seen{$category}++;
>
> I have looked at that, and it extracts the unique items, but will only
> show the last value the hash has seen, which isn't necessarily the
> highest paid unique category, so the ability to sort the unique item
> is lost.
No, it will only show the first value the hash has seen which should be
correct if the original array is sorted highest to lowest as you said.
If you are still having problems, post a small segment of code (and
data) that you've tried, an explanation of what it should do, and of
what it does.
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: Sun, 30 May 1999 14:07:53 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: how to upload file from the form?
Message-Id: <3751A8A9.3789BA18@mail.cor.epa.gov>
Anthony Baratta wrote:
>
> Gleb Ekker wrote:
> >
> > Hi everybody,
> >
> > please, help is needed. I want to upload to the server a file from the
> > form.
> > I use <input name='data' TYPE='file'> in the form and Perl script get
> > from it only path to a file and file name.
> > How can script get the file from a local machine for the futher
> > processing?
>
> get cgi-lib.pl
No, that's a sub-optimal approach. Get the module CGI.pm,
which is better, works with other current modules, and is more
likely to come with an install. Plus it has better documentation
than cg-lib.pl . Now if you're stuck using an ISP who only
supports 4.036...
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Sun, 30 May 1999 18:47:50 -0400
From: "Bill Jones" <bill@fccj.org>
Subject: Re: how to upload file from the form?
Message-Id: <3751bfcf.0@usenet.fccj.cc.fl.us>
In article <3751A8A9.3789BA18@mail.cor.epa.gov>, David Cassell
<cassell@mail.cor.epa.gov> wrote:
> Anthony Baratta wrote:
>>
>> Gleb Ekker wrote:
>> >
>> > Hi everybody,
>> >
>> > please, help is needed. I want to upload to the server a file from the
>> > form.
>> > I use <input name='data' TYPE='file'> in the form and Perl script get
>> > from it only path to a file and file name.
>> > How can script get the file from a local machine for the futher
>> > processing?
>>
>> get cgi-lib.pl
>
> No, that's a sub-optimal approach. Get the module CGI.pm,
> which is better, works with other current modules, and is more
> likely to come with an install. Plus it has better documentation
> than cg-lib.pl . Now if you're stuck using an ISP who only
> supports 4.036...
The biggest SELLING point for CGI.PM is that it
is cgi-lib.pl compatible.
/^True$/
-Sneex- :]
______________________________________________________________________
Bill Jones Data Security Specialist http://www.fccj.org/cgi/mail?dss
Need to get started in Perl? See http://jacksonville.pm.org/Letter.cgi
------------------------------
Date: Sun, 30 May 1999 18:08:12 -0400
From: Eric Weiss <eweiss@winchendon.com>
Subject: Re: Im not asking for much
Message-Id: <3751B6CC.850B21A6@winchendon.com>
Perl is a great language, but I would not want to teach it to someone
who
did not already know another language such as C/C++ or Java. It breaks
all
the current rules, but it works.
If you want to learn Perl, try the book Learning Perl. There are Unix
and
Windows versions. There are also lots of other good books and
commercial
courses. The complete answer depends on what you want to use Perl for,
but
it probably includes Programming Perl. The Perl FAQ and doc are also a
very good source.
Eric
------------------------------
Date: Mon, 31 May 1999 00:30:41 +0400
From: Mike Blazer <blazer@mail.nevalink.ru>
To: Damon Torgerson <a-damont@microsoft.com>
Subject: Re: Measuring space on a share
Message-Id: <37519FF1.D68BFF1A@mail.nevalink.ru>
> I'd like to measure the free space on a series of shares. I'm new to Perl
> and I was wondering if anyone has any recommendations for doing this.
If on Win32 - try my Win32::DriveInfo (link below). It's not extensively
tested on NT (created on Win95) but I hope I will do the job.
--
==================================
Mike Blazer
blazer@mail.nevalink.ru
http://www.dux.ru/guest/fno/perl/
==================================
------------------------------
Date: Sun, 30 May 1999 20:55:04 GMT
From: "George Jempty" <jb4mt@hotmail.com>
Subject: Nesting an if inside a for each loop
Message-Id: <IAh43.1384$ve5.2163@news.rdc1.ne.home.com>
I'm an experienced programmer, but new to Perl. Can someone please explain
what's wrong with the syntax of the following code:
for each $address (@ip_addresses) {
if $address eq $ENV{'REMOTE_ADDR'} {
print "stuff I want to print";
}
}
Without the if construct this works fine.
Hope this is not deemed inappropriate for this group.
George Jempty
------------------------------
Date: 30 May 1999 21:06:48 GMT
From: billynospam@mirror.bt.co.uk (Graham Ashton)
Subject: Re: Nesting an if inside a for each loop
Message-Id: <slrn7l3a39.agn.billynospam@wing.mirror.bt.co.uk>
In article <IAh43.1384$ve5.2163@news.rdc1.ne.home.com>, George Jempty wrote:
>I'm an experienced programmer, but new to Perl. Can someone please explain
>what's wrong with the syntax of the following code:
>
>for each $address (@ip_addresses) {
> if $address eq $ENV{'REMOTE_ADDR'} {
> print "stuff I want to print";
> }
>}
>
>Without the if construct this works fine.
put brackets round it;
if ($address eq $ENV{'REMOTE_ADDR'}) {
>Hope this is not deemed inappropriate for this group.
not at all.
--
Graham
------------------------------
Date: Sun, 30 May 1999 15:15:45 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Nesting an if inside a for each loop
Message-Id: <Pine.GSO.4.02A.9905301512240.15468-100000@user2.teleport.com>
On Sun, 30 May 1999, George Jempty wrote:
> I'm an experienced programmer, but new to Perl. Can someone please
> explain what's wrong with the syntax of the following code:
>
> for each $address (@ip_addresses) {
> if $address eq $ENV{'REMOTE_ADDR'} {
> print "stuff I want to print";
> }
> }
That "for each" doesn't resemble what's found on the perlsyn manpage, and
your if statement is lacking something, too. But from the looks of things,
you seem to be wanting to do something for $ENV{REMOTE_ADDR} only if it's
found within a list of @ip_addresses, so maybe you want to use grep or
something similar. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 30 May 1999 15:26:28 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: REMOTE_USER - How come I can't see it?
Message-Id: <3751BB14.59BE94DF@mail.cor.epa.gov>
ace wrote:
>
> Who cares what you think?
Most of the *knowledgeable* posters in this NG. That's who.
Maybe someday you'll be skilled enough to use and appreciate
some of Alan's code.
> Save your opinions
> for your loser chat sessions.
Does this mean you don't even know the difference between
Usenet and a chat room? Sad.
> At least he replied
> with some kind of information.
Was it the *correct* information? How do you assess
that? Was it information that was supposed to be provided
here? This NG has a general policy and guidelines, some
written and some grokked by the experienced. So that
means that you are...
> Why don't you
> take you lame attitude and save it for when
> you mother catches you jerking off
> while watching porn because you can't get
> a girlfriend with your assinine intellect.
Good. Very good. You just got yourself plonked by
every Perl guru in the known universe. I sure hope
you don't need any Perl assistance in the next decade.
> This newsgroup is for anyone with any questions remotely
> related to perl. It is not limited to your personal definition.
No, you're wrong. You haven't bothered to look at
the charter under which this NG was formed, nor have
you bothered to read enough here to understand the
implications of that charter. And you clearly haven't
gathered the spirit of the NG either.
It is important here to:
[0] demonstrate that you have 'done your homework';
[1] be on-topic (and know what the topic *is*);
[2] be correct;
[3] be civil (unless you're replying to a friend).
> Asshole.
I doubt Alan even read this far down before plonking
you. He has better things to do than to get into
flamewars with people who don't know the difference between
Perl and CGI and HTML.
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 30 May 1999 20:49:24 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Slow, or looping?
Message-Id: <7is88k$9oh$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Ronald J Kimball
<rjk@linguist.dartmouth.edu>],
who wrote in article <1dsmbvr.pv4r4t1w95tdnN@p32.tc2.state.ma.tiac.com>:
> > s/(([a-z]+|[a-z]\-[a-z])+)\s*,?\s*(([a-z]\s*\.\s*)+)(\[^\sa-z]|\Z)/$3 $1/io
> ^^^^^^^^^^^^^^^^^^^^^^
>
> Ignoring the second alternative, this is:
>
> ([a-z]+)+
>
> which is a classic form for execution in exponential time on the length
> of the target string when the regex fails to match.
Please ignore my previous post!
<Sound of beating my head at the wall...>
Of course, it is ordered partitions, thus it is indeed exponential...
Ilya
------------------------------
Date: Sun, 30 May 1999 14:56:20 -0800
From: lunaboy <kinmich1@lycoming.edu>
Subject: Re: Uploading image files..
Message-Id: <928104982.10277@www2.remarq.com>
So what is the proper ENCTYPE that goes into the FORM tag? I
want to do something similar, but I want the user to be able
to upload both image and text files.
-Mike King
**** Posted from RemarQ - http://www.remarq.com - Discussions Start Here (tm) ****
------------------------------
Date: Sun, 30 May 1999 21:58:39 GMT
From: croaker@barkingmad.org (Frank Ney)
Subject: Re: Y2K infected Perl code
Message-Id: <37546ff5.127838110@news.remarq.com>
On 29 May 1999 23:29:31 -0000, an orbiting mind control laser caused
Jonathan Stowe <gellyfish@gellyfish.com> to write:
>And as has been asked over and over and over and over again what do
>*you* propose *we* do about it - shall I tie Matt Wright to a burning
>cross on Parliament green with a sign saying 'So Die All Abusers of
>Localtime' ?
With what has been happening over there you might consider that for your
members of parliament...
Frank Ney N4ZHG WV/EMT-B LPWV NRA(L) GOA CCRKBA JPFO
--
"America is at that awkward stage. It's too late to work within
the system, but too early to shoot the bastards. On the road to
tyranny, we've gone so far that polite political action is about
as useless as a miniskirt in a convent."
- Claire Wolfe, _101 Things To Do 'Til The Revolution_
------------------------------
Date: 30 May 1999 22:26:34 GMT
From: M.Ray@ulcc.ac.uk (Malcolm Ray)
Subject: Re: Y2K infected Perl code
Message-Id: <slrn7l3eoq.8qd.M.Ray@carlova.ulcc.ac.uk>
On Sat, 29 May 1999 20:04:12 GMT, finsol@ts.co.nz <finsol@ts.co.nz> wrote:
>In article <slrn7kt1us.1d8.M.Ray@carlova.ulcc.ac.uk>,
> M.Ray@ulcc.ac.uk (Malcolm Ray) wrote:
>>
>> Programming should not be done by guesswork.
>
>Yes, we all have opinions on how programming should be done and who
>should be doing it. But thats not going to solve the immediate problem
>of existing code thats wrongly programmed. Is that not more of a concern
>right now? What have you and other Perl developers done about that?
Personally, very little of my Y2K work so far has been perl-related,
since we don't employ programmers who don't read documentation. But,
since I support open source, I report bugs and sometimes submit patches
to open source software when I find problems, and that includes Y2K
bugs (see below). As for making the interpreter detect unsafe practice
and warn about it, you'll have seen that there is work going on in
that direction. I'll reserve judgement on that until I've seen it.
>Will
>all Perl Y2K problems that occur be non-critical? Does the Perl
>community take no responsibility in ensuring that Perl developers get
>the message that there is a need to check Perl code for Y2K problems?
>Particularly if there is the chance that they have not fully understood
>the usage of localtime.
The only way the community could do more to get the message across
would be to take out billboard adverts and get Abigail to guest on
the Simpsons.
Nice use of selective quoting, by the way. You ignored the parts of
my article which dealt with concrete coding matters. Well, never
mind. Since you introduced three examples of problematic perl code,
let's look at them in more detail.
http://www.hollycole.com/WWWboard/wwwboard.html:
This is part of the 'ultimate bulletin board'. The name suggests
that the programmer has mastered one of the principle virtues of
a programmer, but reading the code (with difficulty, since it's
poorly formatted) reveals that they still have some way to go.
As you spotted, it misuses localtime, and has Y2K problems. But,
since it's riddled with unchecked opens, such as:
open (FORUMFILE, "$CGIPath/forums.cgi");
...it could fail tomorrow, or next week.
http://www2s.biglobe.ne.jp/~j_okada/free_cgi/j_diary/regist.txt:
This is written in a rather C-like manner, which makes heavy going
of some things which should be easy in perl. The author has some
eccentric ideas about strings, as illustrated by the backwhacking in
this line:
if (!open (DB, "$data_dir/$year$mon\.dat")) {
All opens are checked, though an opendir is used unchecked. It will
fail in the year 2000 (which it will think is '19100'); there's
also an incorrect use of gmtime, which will result in it setting
a cookie with a bad expiry (this will go bad 30 days before Y2K).
Its reading of POSTed form data is not robust. No locking is used
to protect against data loss when files are written.
http://www.linguistic-funland.com/scripts/RemindMe/remindmecgi.txt:
A comment in the code says:
# I also fixed a strange thing that Perl's localtime
# function does to years over 2000, so this should run through 2004.
So at first sight credit is due to the author for being aware of Y2K
issues. But the code is eccentric, to say the least. At one point,
it does this:
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);
if($year !~ /0/){
$form_year = "19$year";
}
else{$year = "20$year";}
This is the code you quoted. The use of $year rather than $form_year
in the last line is probably a typo; regardless, it'll fail next year,
and in a different way in 2011! Elsewhere, there's this code:
if($year >= 100){$year =~ s/^1//; $year = "20$year";}
else{$year = "19$year";}
which fares a little better: it'll fail in the year 2100.
All opens are checked, but pipe closes aren't: presumably the author
hasn't read perlipc. No file locking is used where files are opened
for writing, so there's a distinct danger of data loss.
The program uses its own password file to protect data, but rather than
use a decent one-way encryption algorithm, the author has invented her
own insecure alternative. A comment shows that she's aware that it's
insecure; perhaps she's unaware that better alternatives are available.
None of these three examples use perl's -w flag or 'use strict',
so the programmers are making life more difficult for themselves and
anyone modifying the code. They all have Y2K problems, but even a
cursory examination shows that they all also have bugs which could
cause them to fail at any time. They are all (to varying degrees)
examples of poor programming. Thank-you for choosing these examples,
which demonstrate what people have tried to tell you: misuse of localtime
is symptomatic of bad programming practice, and code exhibiting it is
likely to have other bugs. Perl provides the programmer with more than
one way to shoot themself in the foot, and these three programmers show
multiple bullet wounds. Users of their code may have cause to complain
well before 1/1/2000.
You found those examples. Did you alert the authors to their Y2K bugs?
After all, it would surely be irresponsible to use their code to
illustrate bad practice without giving them a chance to fix it.
In case you didn't, I've contacted them.
Disclaimer: I don't know whether what I've described here are the
current versions of these packages. It's possible that we're talking
about old versions, and all the bugs have since been fixed.
--
Malcolm Ray University of London Computer Centre
------------------------------
Date: 12 Dec 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 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 5836
**************************************