[6732] in Perl-Users-Digest
Perl-Users Digest, Issue: 357 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 23 18:17:36 1997
Date: Wed, 23 Apr 97 15:00:30 -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 Wed, 23 Apr 1997 Volume: 8 Number: 357
Today's topics:
Re: 2D matrices <rra@stanford.edu>
Re: A Perl modules confusion... (Ronald L. Parker)
Re: A stupid thing! (Andreas Karrer)
dbmopen and perl5 <gsarlas@foobar.res-hall.nwu.edu>
Re: Document Contains No Data (John L. Daschbach)
Getting a user's ip address? <ian.feldberg@jhuapl.edu>
Re: has someone written a word counter (not a wc clone) (Matthew D. Healy)
Re: Lisp is neither (was Re: Ousterhout and Tcl lost th (Henry Baker)
Re: Lisp is neither (was Re: Ousterhout and Tcl lost th <david@nospan.netright.com>
Re: Lisp is neither (was Re: Ousterhout and Tcl lost th <erik@naggum.no>
Re: Lisp is neither (was Re: Ousterhout and Tcl lost th <rsi+usenet@fragola.hr.lucent.com>
Re: Need a math program (Kenneth Albanowski)
Re: Newbie Help - Format an Integer with Comma's <deepak@pcsltd.com>
Re: No syntax errors, but still the thing won't run (Tad McClellan)
Re: No syntax errors, but still the thing won't run <gtk@walsh2.med.harvard.edu>
Re: Ousterhout and Tcl lost the plot with latest paper (Henry Baker)
Re: Ousterhout and Tcl lost the plot with latest paper (tomlinson)
PERL & ADO - SQL INSERT slows after 100 Executions <rtremble@ctissrv1.plt.ford.com>
Re: perl in commercial product, what to take care of? (Andreas Karrer)
Re: Regular Expression Help Newbie (David P. Huff)
Re: Regular Expression Help Newbie (Andreas Karrer)
Re: Regular Expression Help Newbie <deepak@pcsltd.com>
SysV IPC under Linux 2.0, can't get non-blocking to wor (John L. Daschbach)
Re: Who will win? Borland or Microsoft or Programmers? <ms@aol.com>
Re: why cant I access/print a list-of-lists this way <mcampbel@tvmaster.turner.com>
www-based e-mail <greg@skokie.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 23 Apr 1997 13:26:34 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: 2D matrices
Message-Id: <qumpvvl1o5h.fsf@cyclone.stanford.edu>
Kyzer <junkmail@sysa.abdn.ac.uk> writes:
> From the lips of Russ Allbery sprang:
>> man perllol has a lot of details on precisely how this works, and more
> that's perlLoL you mean...
> Someone write a version of man(1) that isn't case dependant!
Given that the commands one is trying to get documentation for generally
*are* case-dependent, that would be a bad thing.
--
Russ Allbery (rra@stanford.edu) <URL:http://www.eyrie.org/~eagle/>
------------------------------
Date: Wed, 23 Apr 1997 21:24:16 GMT
From: ron@farmworks.com (Ronald L. Parker)
Subject: Re: A Perl modules confusion...
Message-Id: <33607671.16623113@10.0.2.33>
[courtesy cc of this posting sent to cited author via email]
On 20 Apr 1997 03:02:59 GMT, Tom Christiansen <tchrist@mox.perl.com>
wrote:
>In comp.lang.perl.misc,
> dblack@icarus.shu.edu (David Alan Black) writes:
>:Yeah, Perl5.003 is a very sloppily written language.
>:
>:For instance, if you assign to a variable twice, as you do here
>:with @EXPORT:
>:Perl5 honors the second assignment. Yuck.
>
>
>David, Are you having an out of mind experience?
Given that David also wrote
P.S. I'm not blindly defensive of every aspect of Perl, and I've had
my share of being stumped by programming errors which are obvious to
another pair of eyes at a glance. But given what's being done with
Perl5, it's a pretty safe assumption that it isn't fundamentally an
incompetent hack.
I think we can safely assume that the statement about sloppiness was
intended as sarcasm. The original poster was the one who accused the
authors of Perl of sloppy coding. (If Perl is sloppy code, I'd pay to
see _good_ code.)
--
Ron Parker
Software Engineer
Farm Works Software Come see us at http://www.farmworks.com
For PGP public key see http://www.farmworks.com/Ron_Parker_PGP_key.txt
------------------------------
Date: 23 Apr 1997 20:56:33 GMT
From: karrer@ife.ee.ethz.ch (Andreas Karrer)
Subject: Re: A stupid thing!
Message-Id: <slrn5lsts8.6t4.karrer@kuru.ee.ethz.ch>
In article <335E4B1A.6A8F@iaehv.nl>, Biczok Norbert wrote:
>do you have any suggestions why this command does not work:
>
>s/<.*?>//g;
>
>and gives the following error message:
>
>/<.*?>/: nested *?+ in regexp at .....
Because you are using a perl5 feature (the ?, non-greedy regex
quantifiers) with perl4.
% echo "4< you >2" | perl -pe 's/<.*?>//g'
42
% echo "4< you >2" | perl4 -pe 's/<.*?>//g'
/<.*?>/: nested *?+ in regexp at /tmp/perl-ea006aV line 1.
If you must use perl4 -- strongly discouraged! -- you could say:
% echo "4< you >2" | perl4 -pe 's/<[^>]*>//g'
42
- Andi
------------------------------
Date: Wed, 23 Apr 1997 14:28:15 -0500
From: George Sarlas <gsarlas@foobar.res-hall.nwu.edu>
Subject: dbmopen and perl5
Message-Id: <Pine.LNX.3.95.970423141610.1818A-100000@foobar.res-hall.nwu.edu>
Ok, I have read over countless man pages and FAQ texts, but I am still
confused. For the past 6 months, I have successfully written scripts
using dbmopen() and dbmclose() that worked under perl4. But now I moved
to a new machine, running Solaris 2.5 with perl 5.002, and I am baffled.
I was wondering if anyone could shed some light on this, or point me to a
thorough source to help me learn about what's going on.
Here's what happens.
When I run this simple, dinky little script:
#!/usr/local/bin/perl
dbmopen (%mydata, "./mydata", 0666);
$mydata{'Hello'} = "hellostring";
dbmclose (%mydata);
I get the following error:
AnyDBM_File doesn't define a TIEHASH method at ./mytest.pl line 3
I've tried various DBM modules like SDMB_File.pm, NDMB_File.pm, etc., but
nothing seems to work. Can anyone help me? Thanks very much in advance.
George Sarlas
gsarlas@nwu.edu
------------------------------
Date: 23 Apr 1997 08:10:10 -0700
From: d3h486@wd19518.pnl.gov (John L. Daschbach)
Subject: Re: Document Contains No Data
Message-Id: <m367xdixm5.fsf@wd19518.pnl.gov>
ranger@onramp.net (Gregory Reddin) writes:
>
>
> I recently moved the website from Unix to Window NT.
>
> Can anyone help?
>
Move back to Unix.
------------------------------
Date: Wed, 23 Apr 1997 14:40:19 -0500
From: Ian Feldberg <ian.feldberg@jhuapl.edu>
Subject: Getting a user's ip address?
Message-Id: <335E6598.1481@jhuapl.edu>
Does anyone know of an easy way to get the ip address of a remote user
of a Perl script? That is, I'm writing a cgi script in perl and I want
to return different data depending on the ip address of the person who
invokes the script from within Netscape.
- Ian
------------------------------
Date: Wed, 23 Apr 1997 16:58:34 -0500
From: Matthew.Healy@yale.edu (Matthew D. Healy)
Subject: Re: has someone written a word counter (not a wc clone)
Message-Id: <Matthew.Healy-2304971658340001@pudding.med.yale.edu>
Show the 15 most common words in today's crop of email messages:
(92)% cat ma*97*23*|tr -cs A-Za-z '\012'|tr A-Z a-z|sort| uniq -c|
sort -n -r|head -15
230 the
167 to
151 you
139 com
114 a
111 apr
106 from
103 and
101 of
92 list
87 mail
84 this
80 in
74 for
67 that
seviche(93)%
(Sometimes, there's really More Than One Way To Do It :)
No doubt Tom could probably devise a Perl one-liner that does
the same thing, but the above is how I typically do such tasks!
---------
As of 22 Apr 1997, 983 days till Y2K....
Matthew.Healy@yale.edu
http://paella.med.yale.edu/~healy
"But I thought it was pointed at the rabbit *between* my feet!"
---------
Help a victim of severe email harrassment, see
http://www.geocities.com/~hitchcockc/story.html#fund
---------
------------------------------
Date: Wed, 23 Apr 1997 20:54:47 GMT
From: hbaker@netcom.com (Henry Baker)
Subject: Re: Lisp is neither (was Re: Ousterhout and Tcl lost the plot)
Message-Id: <hbaker-2304971254470001@10.0.2.1>
In article <335E3AFB.73B4@polaroid.com>, prasadm@polaroid.com wrote:
> Maybe Lisp is just not suited for commercial use. I have
> also seen (been at, actually) a very highly successful
> company, SAI, bet the farm on Lisp-like languages, and
> lose it big. Lisp success stories dramatic enought to balance
> that, seem to be missing.
Gensym? Cadence?
------------------------------
Date: Wed, 23 Apr 1997 14:23:26 -0500
From: David Hanley <david@nospan.netright.com>
Subject: Re: Lisp is neither (was Re: Ousterhout and Tcl lost the plot)
Message-Id: <335E61AE.3F53@nospan.netright.com>
Erik Naggum wrote:
>
> * Erik Naggum
> | (yes, CPU's _do_ have instructions that C compilers don't use.)
>
> * Donal K. Fellows
> | I take it you don't work in computer hardware design, and haven't even
> | looked at the field for at least 10 or 15 years, since that last
> | statement is plain wrong. Maybe Vaxes had a "Reverse Bit Shift, Cast
> | to Type and Catch Fire if the Programmer is Stupid" instruction (with
> | mnemonic RBSCTCFPS :^) but technology is substantially advanced since
> | then. RISC CPU's have only the instructions that are measured as
> | being needed in practice, and virtually all new designs are RISC (with
> | the notable distiction of the ix86 line of processors). In future, try
> | to check your facts, and especially those that have been contradicted
> | by people (with good reason) for loads of years...
>
> geez.
>
> the SPARC architecture has several instructions that C compilers doesn't
> use, but which are convenient with type-tagged languages. the _fact_ is
> that it has an the instruction, with Sun's recommended mnemonic "taddcctv",
> that is specifically useful in Lisp, and specifically unused in C. other
> instructions are also measurably useful in languages _other_ than C.
Ok, so you found one example on one CPU. Great. Do you have any
others?
Because when you say 'cpu's XXX' it means that most or all cpu's have
that
feature. But there's more..
>
> C is _not_ the be-all, end-all of programming languages and C is _not_ the
> universal assembler that some would like it to be. that you cannot even
> put this instruction to use without a lot of prior work that you also have
> a hard time doing in C, shows that the SPARC designers thought of more than
> increasingly myopic C crowd.
I would think it's better to be myopic than to have your eyes shut.
The fact is, most newer chips are not designed for lisp at all. The
basic
operations certianly are not based on type.
Accusing someone of being stupid, and making stupid arguments oneself
does make someone look like a fool though; though it's not who you're
insulting.
>
> but to demonstrate the point with a real-life example, take the following
> (silly) function, compiled by Allegro Common Lisp for Unix on a SPARC:
>
> (defun foo (x y) (declare (fixnum x y)) (+ x y))
>
> 0: cmp %g3, #x2
> 4: tne %g0, #x13
> 8: taddcctv %g0, %g1, %g0
> 12: sra %o0, #x2, %o0
> 16: sra %o1, #x2, %o1
> 20: add %o0, %o1, %o0
> 24: ld [%g4 + 135], %g2 ; fixnum-or-bignum
> 28: jmp %g2 + 0
> 32: xor %g0, #x1, %g3
>
> the intelligent reader will recognize that this function sports a few
> features not commonly found in C compiler output: the number of incoming
> arguments is in a register, there are traps to handle error conditions, and
> it concludes with a jump to a function instead of a call and return. (no
> programmer knowledgeable of pipelines RISCs will wonder why the jmp occurs
> before the argument count is stored into %g3.)
Once again, making broad allegations of stupidity doesn't make you look
smart when you say foolish things.
I'm glad that the usual C compiler will not produce the preceeding
code.
I'm glad the usual java compiler will not produce the preceeding code.
First of all, it specifies fixnums, but appears to be performing the
computation
for all types--nice optimization. And testing the number of parameters
is only
necessary due to the structure of lisp--berating C compilers for not
doing this is silly.
Also, it appears that the whole function ought to be compiled to a
single tail-recursive jump or inlined for that matter.
>
> I welcome suggestions on how to accomplish the _exact equivalent code_ from
> C source code. if this cannot be done, could Donal K. Fellows then accept
> that some CPU's (1) do have instructions that C compilers don't use, and
> (2) that he shot his mouth off? I assume both, so let's return to our
> regular program.
Perhaps you could try counting to 100 before responding to someone
on the net? The time might be used to actually think about what you're
posting,
which might work wonders.
> Bastard Sex Therapist from Hell: "Read the F*cking Manual!"
A freudinan message??
dave
------------------------------
Date: 23 Apr 1997 20:17:16 +0000
From: Erik Naggum <erik@naggum.no>
Subject: Re: Lisp is neither (was Re: Ousterhout and Tcl lost the plot)
Message-Id: <3070815436720561@naggum.no>
* M. Prasad
| Is it just my perception, or does this gent really have a severe attitude
| problem?
it's just your perception. or rather, your uncanny ability to provoke. if
you set out rumors about somebody or attack them without cause, such as you
do, I think it's evidence of a serious character flaw to attack them of
attitude problems if they don't like it.
specifically, I'm reacting to the persistent unfairness in your messages.
again, I find your negativism indicative of something more serious than
just attitude problems. in fact, I think you appear to be vengeful and
unable to think clearly because negative emotions cloud your judgment.
this is the rest of the article from M. Prasad that I replied to:
Maybe Lisp is just not suited for commercial use. I have
also seen (been at, actually) a very highly successful
company, SAI, bet the farm on Lisp-like languages, and
lose it big. Lisp success stories dramatic enought to balance
that, seem to be missing.
Or maybe it was just some really bad Karma :-) I understand rms
was very unhappy with at least one of these dudes...
what have we learned from this? which facts are communicated? which ideas
have seen expression? M. Prasad is the antithesis of communication.
the other day, we could read the following fascinating comments from him:
How about you stop giving Lisp a bad name with these tactics of yours?
It gives the impression that Lisp is only used by fanatics.
(I suggest that other people who do not want to see this impression
continue, should join in an attempt to squelch this highly errant
behavior...)
> again, why should anyone trust your judgment on this? you are
> clearly unable to recognize the simple fact that you don't know Lisp
> in practice well enough to pass judgment on it. yet you make a big
> stink about
Never stopped *you* from making comments about Lisp, now, did it?
these aren't arguments, this doesn't bring anything new to any discussion,
this only hits on Lisp (and/or me) for no good reason. such is M. Prasad's
modus operandi. M. Prasad goes on to prove that he has nothing whatsoever
to tell any of us in the article I'm responding to.
M. Prasad, to be specific, you seem to have a problem with _me_, not with
anything I do or say or think, but with me and only with me. if you wish
to solve this problem, you can mail me, we can talk about it, and you can
perhaps get a (peaceful) life. if you _don't_ want to solve your problem,
do it _away_ from USENET, OK?
#\Erik
--
if we work really hard, will obsolescence be farther ahead or closer?
------------------------------
Date: 23 Apr 1997 16:42:22 -0400
From: Rajappa Iyer <rsi+usenet@fragola.hr.lucent.com>
Subject: Re: Lisp is neither (was Re: Ousterhout and Tcl lost the plot)
Message-Id: <xnyenc1a2tt.fsf@placebo.hr.lucent.com>
"M. Prasad" <prasadm@polaroid.com> writes:
> Erik Naggum wrote:
> >
> > * M. Prasad
> > | We seem to have lots of opinions, with a fair amount of blame placement
> > | on management. But you don't get to manage a start-up with that many
> > | high-powered brains, unless you are really good and proven. So I still
> > | doubt the "bad management" theory very much.
> >
> > I think it would be instructive for you to study the demise of Lucid,
>
> Is it just my perception, or does this gent really
> have a severe attitude problem?
Erik may have an attitude problem, but what he writes is generally
right on. Why don't you take the high road and address the relevant
portions of his post and ignore the attitude?
Regards,
Rajappa
--
Rajappa Iyer <rsi+usenet@fragola.hr.lucent.com> #include <std_disclaimer>
They also surf who only stand on the waves.
------------------------------
Date: 23 Apr 1997 05:03:01 -0400
From: kjahds@kjahds.com (Kenneth Albanowski)
Subject: Re: Need a math program
Message-Id: <5jkj85$80j@kjahds.com>
>In article <33537bf3.380389@nntp.ix.netcom.com>,
> <netwatch@ix.netcom.com> wrote:
>>I need a perl program that will add.sub, multi, amd div. numbers.
>>It must have 3 levels of difficulty. Level 1 use numbers from 1 to 5,
>>level 2 use numbers from 1 to 20, and level 3 use numbers from 1 to
>>50.
No problem. Here you go, add, sub, div, mult, the lot:
perl -e 'print eval "@ARGV"'
I'll admit it doesn't have difficulty levels, but seeing as I didn't use any
numbers at all, I think it qualifies.
>>I also need a perl program that can be use as a address book. It must
>>have name and phone number fields
Ah, that's trickier, but I think this should suffice:
perl -i- -e' print `cat db`; '""' system("echo @ARGV >> db ")'
Since it's harder to get anything more complex then tab separated fields
from simple code like this, I'd advise using a short Eiffel or Haskell
scripts to name the fields. But you can certainly use fields within the set
[name, number] in relation to tab indecies derived from the Peano arithmetic
O and OS (where O is the origin, and S is the usual successor operation).
>>Thank you.
It wasn't any trouble, I assure you.
--
Kenneth Albanowski (kjahds@kjahds.com)
------------------------------
Date: Wed, 23 Apr 1997 15:01:37 -0400
From: Deepak Thadani <deepak@pcsltd.com>
Subject: Re: Newbie Help - Format an Integer with Comma's
Message-Id: <335E5C91.400C@pcsltd.com>
Just wanted to thank you all for your help. I'll read up on the
FAQ and I'll also check out that section of the book.
Deepak
Deepak Thadani wrote:
>
> Hello,
> I'm sorry to ask such a question, but I can't really
> figure this out. Is there some kind of format command in perl
> which places commas in between numbers for me? Say I had a
> variable $VALUE with a value of 1024000. Is there a function
> or something I could use to get $VALSTR to be "1,024,000" ?
> Something more ledgible, something with commas. How?
>
> Thanks again all.
>
> Deepak <deepak@pcsltd.com>
------------------------------
Date: Wed, 23 Apr 1997 13:45:22 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: No syntax errors, but still the thing won't run
Message-Id: <2cllj5.5k7.ln@localhost>
Kevin Cotter (rant@lp-llc.com) wrote:
: Let me respond this way.
: First I (Kevin Cotter) wrote the message Tom Pheonix responded to.
: Now, Excuse me Asshole :-)
Name calling, even with a smiley, is uncalled for.
: for trying to learn a new skill. I don't
: just want to use someones elses code without being able to understand
: what it's doing.
But you didn't say that this was just an exercise to learn perl.
Tom probably put his forehead on the CRT trying to divine if you
were doing it as an exercise, or because it had to be done as part
of some larger work. His mind-reading capability must have been
sub-optimal that day...
In the absence of such a statement, it is quite natural to assume that
you have some real work you are trying to get done, and the form
decoding is just necesary housekeeping to enable the real work.
Using modules for routine stuff is a Good Idea, so Tom's advice is sound.
: I appreciate you responding to my query but in the future if all you're
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Sure doesn't sound like it...
: going to do is tell me what a moron I am then don't waste the space on
^^^^^^^^^^^^^^^^^^^^^^^^^
I don't see where he told you that.
Are you sure *you* didn't infer that part?
Even I could read into it that he said your *code* was moronic, but
he didn't say that *you* were a moron (though *this* post would seem
to contribute to such an evaluation ;-)
The code *is* pretty silly. Silliness would be understandable if we
had known that this was simply an exercise, but again, you didn't
tell us that...
: the newsgroup. I understand that with your superior intellect it must
: be a pain to deal with us idiots - God I know you've never had a problem
: with a program and YOU NEVER asked a stupid question about coding. You
: were born with these skills.
Pout, pout, pout.
: I bow to you my Lord, Tom Phoenix.
If this hadn't been said factiously, then my opinion of you would
have been increased. But is was, so it isn't.
I have only three c.l.p.m posters in my "hot list".
Tom is one of them (I think the other two wrote a book or something).
You would do well to read every post of his if you want to learn
a bunch of perl stuff...
: I apoligize to anyone else in this newsgroup that is offended by my
: response. And sorry for taking up room in this newsgroup with my
: venting.
_I_ am offended by your posting.
This type of post is a good way to end up killfiled, which would
have a negative impact on your being able to get any future perl
questions answered...
: Tom Phoenix wrote:
: >
: > On 22 Apr 1997, Tammy Cotter wrote:
: >
: > > if ($ENV{'REQUEST_METHOD'} eq 'POST') {
: > > # Get the input
: > > read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
: > > @pairs = split(/&/, $buffer);
: > > foreach $pair (@pairs) {
: > > ($name, $value) = split(/=/, $pair);
: > > }
: > > }
: > > else {&error;}
: >
: > Number one, you're doing this the wrong way. That's not a good way to
: > decode web input.
: >
: > And, B, do you see that in your inner loop you're overwriting $name and
: > $value for each item? That's going to discard all but the last set.
: >
: > Third, you should be using CGI.pm or another module from CPAN, which will
: > do all you need and more. (CGI.pm can even let you test your module
: > without the server, which is pretty handy.) In your attempt to reinvent
: > the wheel, you seem to have gotten a flat tire. :-)
: >
: > IV. Hope this helps!
: >
: > -- Tom Phoenix http://www.teleport.com/~rootbeer/
: > rootbeer@teleport.com PGP Skribu al mi per Esperanto!
: > Randal Schwartz Case: http://www.lightlink.com/fors/
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 23 Apr 1997 17:04:35 -0400
From: Gregory Tucker-Kellogg <gtk@walsh2.med.harvard.edu>
To: raven@lp-llc.com
Subject: Re: No syntax errors, but still the thing won't run
Message-Id: <w2afmpxxgc.fsf@walsh2.med.harvard.edu>
Why the hostile complaint, Mr. Cotter? Tom Phoenix anwered your
question, pointed out an error in your loop, suggested a better
method, and wished you well ("Hope this helps"). He was succinct,
thorough, and, if you had taken his advice, helpful. He did not "tell
[you] what a moron [you are]", or anything else reasonably construed
as insulting.
You owe him an apology.
Kevin Cotter <rant@lp-llc.com> writes:
>
> Let me respond this way.
>
> First I (Kevin Cotter) wrote the message Tom Pheonix responded to.
>
> Now, Excuse me Asshole :-) for trying to learn a new skill. I don't
> just want to use someones elses code without being able to understand
> what it's doing.
>
> I appreciate you responding to my query but in the future if all you're
> going to do is tell me what a moron I am then don't waste the space on
> the newsgroup. I understand that with your superior intellect it must
> be a pain to deal with us idiots - God I know you've never had a problem
> with a program and YOU NEVER asked a stupid question about coding. You
> were born with these skills. I bow to you my Lord, Tom Phoenix.
>
> I apoligize to anyone else in this newsgroup that is offended by my
> response. And sorry for taking up room in this newsgroup with my
> venting.
>
>
> Tom Phoenix wrote:
> >
> > On 22 Apr 1997, Tammy Cotter wrote:
> >
> > > if ($ENV{'REQUEST_METHOD'} eq 'POST') {
> > > # Get the input
> > > read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
> > > @pairs = split(/&/, $buffer);
> > > foreach $pair (@pairs) {
> > > ($name, $value) = split(/=/, $pair);
> > > }
> > > }
> > > else {&error;}
> >
> > Number one, you're doing this the wrong way. That's not a good way to
> > decode web input.
> >
> > And, B, do you see that in your inner loop you're overwriting $name and
> > $value for each item? That's going to discard all but the last set.
> >
> > Third, you should be using CGI.pm or another module from CPAN, which will
> > do all you need and more. (CGI.pm can even let you test your module
> > without the server, which is pretty handy.) In your attempt to reinvent
> > the wheel, you seem to have gotten a flat tire. :-)
> >
> > IV. Hope this helps!
> >
> > -- Tom Phoenix http://www.teleport.com/~rootbeer/
> > rootbeer@teleport.com PGP Skribu al mi per Esperanto!
> > Randal Schwartz Case: http://www.lightlink.com/fors/
--
Gregory Tucker-Kellogg
Department of Biological Chemistry and Molecular Pharmacology
Harvard Medical School, Boston MA 02115
"Mojo Dobro" Finger for PGP info
------------------------------
Date: Wed, 23 Apr 1997 20:53:18 GMT
From: hbaker@netcom.com (Henry Baker)
Subject: Re: Ousterhout and Tcl lost the plot with latest paper
Message-Id: <hbaker-2304971253180001@10.0.2.1>
In article <5jlmam$r2a$1@sparky.franz.com>, kem@franz.com wrote:
> When it is much clearer and accessible if it is written like this:
>
> (let x = 10
> y = 20
> do
> (loop for i from 1 to 10
> do
> (if (> x y)
> then
> 10
> elseif (< x 0)
> then
> 20
> else
> nil)
>
> And has no less power than the more parenthesized version:
> The functional view is just the same, and macros are no less powerful.
Do this on your own time if you wish (that's the whole point of Lisp,
isn't it?), but please don't waste anyone's time standardizing this. The
'standard' Lisp should be somewhat smaller than Scheme, with the basic
engine defined. _Everything_ else should be libraries, packages, etc.
The various libraries and packages can be separately standardized, if you
want, but don't bog down the basic engine with this stuff.
------------------------------
Date: 23 Apr 1997 20:10:03 GMT
From: etomlins@rohan.sdsu.edu (tomlinson)
Subject: Re: Ousterhout and Tcl lost the plot with latest paper
Message-Id: <5jlqar$2kd$1@hole.sdsu.edu>
Kelly Murray (kem@franz.com) wrote:
<snip>
: (let ((x 10) (y 20))
: (do ((i 0 (+ i 1)))
: ((> i 10) x)
: (cond ((> x y) 10)
: ((< x 0) 20))))
: When it is much clearer and accessible if it is written like this:
: (let x = 10
: y = 20
: do
: (loop for i from 1 to 10
: do
: (if (> x y)
: then
: 10
: elseif (< x 0)
: then
: 20
: else
: nil)
I think that I just might be in my "Lisp mindset"--a mindset
necessitated by a class in AI which I am taking at the moment,
which requires that I write large amounts of Lisp code every
week.[1] In any case, _at this particular moment in time_, the
top version, with all the nasty parentheses, I find easier
to read and more understandable than the bottom version, with
all these silly, unnecessary little words everywhere, that
take up valuable keystrokes and lines. Anyway. After the
class is over and I'm back to C and C++ all the time, Version
B will begin to look better than Version A.
Cheers,
-et
[1] Aside: as an experiment I tried rewriting one of my Lisp
examples into Java, just to see how long it would take. It took
perhaps twice as long--not so good as Lisp with respect to
speed of coding, but pretty good.
--
Ernest S. Tomlinson | "For every Government consists of mere men and is,
etomlins@rohan.sdsu.edu | strictly viewed, a makeshift; if it adds to its
------------------------+ commands 'Thus saith the Lord', it lies, and lies
dangerously." - C. S. Lewis
------------------------------
Date: Wed, 23 Apr 1997 17:29:44 -0400
From: "Robert J. Trembley" <rtremble@ctissrv1.plt.ford.com>
Subject: PERL & ADO - SQL INSERT slows after 100 Executions
Message-Id: <335E7F48.7391@ctissrv1.plt.ford.com>
I have a Perl app that reads a line of data from a file, and does an
INSERT INTO...a database (via ADO). The code is working fine - the
problem I'm having is for files with greater than 100 lines, the first
100 Inserts are blindingly fast, thereafter each record takes 1-2
seconds.
My ADO code looks like this:
=========================================================
$DB = CreateObject OLE "ADODB.Connection";
$DB->Open( "MyDataSource" );
open hFile, $FilePath;
while($szLine = <hFile>) # Read each line in the file and parse it
{
($name, $dept, $crap, $date, $name1, $name2, $name3) = split
/%/, $szLine;
$DB->Execute("Insert into table values
('$name','$dept','$crap','$date','$name1','$name2','$name3')");
}
close hFile;
}
$DB->Close;
=========================================================
Should I be creating a COMMAND object and setting the text of the SQL?
Suggestions?
------------------------------
Date: 23 Apr 1997 20:48:49 GMT
From: karrer@ife.ee.ethz.ch (Andreas Karrer)
Subject: Re: perl in commercial product, what to take care of?
Message-Id: <slrn5lstdh.6t4.karrer@kuru.ee.ethz.ch>
In article <335DFCEA.53BB@bbn.hp.com>, Christoph Marquardt wrote:
>I need to find out what I should take care of if I want to use Perl
>in a commercial product.
>
>Do you have any pointers to information about
>
> - what copyrights/pointers etc. need to be kept with Perl?
> - what files/libs/... are required to have a minimum functioning
> distribution?
Since HP EEsof includes perl (version 4.019, uh-oh) in their MDS 7.0
(Microwave and RF Design System) product, that information should be
avaliable in-house :-)
- Andi
------------------------------
Date: 23 Apr 1997 20:09:14 GMT
From: david@ti.com (David P. Huff)
Subject: Re: Regular Expression Help Newbie
Message-Id: <5jlq9a$6cq@dsk92.itg.ti.com>
In article <335D6579.7DDA@pcsltd.com>, deepak@pcsltd.com says...
>
> <snip>
>
>Please help...and explain how I can figure out reg exp's better if
>possible. Thanks a lot.
Since you've already recv'd other replies, I'll just mention a resource that's
helped me out a great deal:
_Mastering Regular Expressions_ (aka the "cute" or "hip" owls book)
Friedl, Jeffrey
1997, O'Reilly & Assoc.
ISBN 1-56592-257-3
http://www.ora.com/ O'Reilly Home Page
http://enterprise.ic.gc.ca/~jfriedl/regex/ the author's own page
on this book
Regards,
David Huff
Texas Instruments, Inc.
------------------------------
Date: 23 Apr 1997 20:30:17 GMT
From: karrer@ife.ee.ethz.ch (Andreas Karrer)
Subject: Re: Regular Expression Help Newbie
Message-Id: <slrn5lssb0.6t4.karrer@kuru.ee.ethz.ch>
In article <335D6579.7DDA@pcsltd.com>, Deepak Thadani wrote:
>Hello,
> I have a perl script in which
>$_ = "881 /usr/spool/mmdf/lock/home"
>
>What I want to do is get the number (in this case 881) into a variable
>called $VALUE. This is what I've got, which only seems to return
>the 1.
>
>$VALUE = /[0-9]*\S\//;
In a scalar context a pattern match returns the number of times it
matched. The assignment to a scalar variable above creates a scalar context.
In a list context, tha pattern match returns a list of matched
subpatterns, e.g. the list $1, $2, $3 etc. An assignment to an array
variable or to a explicit list are ways to create an list context.
So
($VALUE) = /^(\d+)\s+\// or die "Uh-oh: no leading number\n";
assigns what matched in the first ()-pair to $VALUE.
- \d is short for [0-9]
- You want \d+, not \d*. \d* matches zero or more
times, it *also* matches the null string.
- \s is whitespace, \S is non-whitespace
- the example has more than one whitespace characters between
the number and the first slash, so \s+ is probably meant.
>What I believe the above is doing is getting all the numbers until
>I get to a white space or / right? Apparently wrong since $VALUE
>after running that line, is simply 1.
Your regex matched the string "r/" in "usr/spool", namely:
[0-9]* zero digits (matches the null string between "u" and "r")
\S followed by a non-whitespace character: "r"
\/ followed by a slash
Quite possibly not the intended match.
- Andi
------------------------------
Date: Wed, 23 Apr 1997 15:09:42 -0400
From: Deepak Thadani <deepak@pcsltd.com>
Subject: Re: Regular Expression Help Newbie
Message-Id: <335E5E76.4CB@pcsltd.com>
Deepak Thadani wrote:
>
> Hello,
> I have a perl script in which
> $_ = "881 /usr/spool/mmdf/lock/home"
>
> What I want to do is get the number (in this case 881) into a variable
> called $VALUE. This is what I've got, which only seems to return
> the 1.
>
> $VALUE = /[0-9]*\S\//;
>
> What I believe the above is doing is getting all the numbers until
> I get to a white space or / right? Apparently wrong since $VALUE
> after running that line, is simply 1.
>
> Please help...and explain how I can figure out reg exp's better if
> possible. Thanks a lot.
>
> Deepak <deepak@pcsltd.com>
Phew...thanks for the help all. I think I'm getting to understand
this stuff a bit better now.
Thanks again.
Deepak
------------------------------
Date: 17 Apr 1997 17:17:15 -0700
From: d3h486@wd19518.pnl.gov (John L. Daschbach)
Subject: SysV IPC under Linux 2.0, can't get non-blocking to work
Message-Id: <m3afmxmbg4.fsf@wd19518.pnl.gov>
I tried posting this sometime ago. Using Perl 5.003 and Linux 2.0.xx
I can use the standard msg and sem calls from Perl, but they always
block, even if I use semctl or msgclt with a non-blocking flag. This
works as long as you wan't the Perl process to block and wait for
another process, but often you would just like to check the state of a
semaphore or queue.
Does anyone have this working on Linux, or another Unix flavor. My
AIX box is at 5.002 and I haven't tried there.
-John
------------------------------
Date: 23 Apr 1997 22:00:35 GMT
From: "pit@aol.com" <ms@aol.com>
Subject: Re: Who will win? Borland or Microsoft or Programmers?
Message-Id: <5jm0q3$hl6@news.cuny.edu>
chas@aol.com wrote:
>
> What the hell does this have to do with all these irrelevant news
> groups.
> Someone stop cross posting.
Looks like as long as Microsoft will exist, there will be no peace in the world.
>
> chas@aol.com wrote:
> >
> > mac@macsofta.com wrote:
> > >
> > > > M A wrote:
> > > >
> > > > Hi,
> > > > My company is planning to start a project. We have a big question
> > > > about our investments. We don't know if we should use Microsoft
> > > > compiler or Borland. Some myth we heard over the net.
> > > >
> > > > 1) 90% of the programmer uses Microsoft Compiler.
> > > > That's absoutly untrue for now and future..
> > > ---90% uhh, since when. I just looked up TRST report and that says 50%
> > > Microsoft, 30% Borland, and 20% all others...
> >
> > Sounds Good!
> > > > > 2) Borland will vanish in 2 years (NASDAQ:BORL)
> > > > Borland's bad finicial situation was issused four years ago, somebody
> > > > said Borland will vanish in 2 years, and 4 years passed, look what's
> > > > happening?
> > >
> > > That won't happen. Look at Netscape. It is still alive and running
> > > faster then ever.
> > Boland is the technological leader and can't vanish in 8 years.
> > > > > 3) Borland has better compiler
> > > > Well, they have the fastest compiler for C++ (C++Builder), TOP
> > > > RAD(Delphi) and Very Very Fogotten but a very very professional and
> > > > powerful Visual dBase.. Actually, they have better compiler.. But
> > > > language itself is not only compiler..(Forget I didn't metion both
> > > > Borland and Microsoft doesn't support mulitiple-platform, yet..)
> > >
> > > Entera or what ever from Borland will set the standard for next 10
> > > years.
> > What is Entera?
> > > > > 4) 99% of the College in US have/use Borland Compiler.
> > > > That's absoutly untrue, either..
> > > Well it more like 80%.
> > Do I care.
> > > > If you want to choose project between Borland and Microsoft, my
> > > > suggestion is depended on what do you actually need. Actually, if you
> > > > wnat to make DOS-GAMES, window PE and all kinds of mutiple-platform PC
> > > > apps, choose Borland C++ 5.1 (VC++ doesn't support these platform
> > > > anymore..) if you want RAD, choose Delphi. If you are using MS-Office
> > > > (which is the top office suite), choose VB. If you have a bunch of
> > > > people accustomed to MFC class library, choose VC++..
> > > >
> > > > And also, if you are using Linux, UNIX, X windows, SUN, and others, IBM
> > > > visual Age is the best choice..
> > > >
> > > > >
> > > > > Some one show us the way?
> > > > >
> > > Don't worry about the size of Microsoft. Your company need productivity
> > > so go for Borland. After all if you have a good product it will make up
> > > all the investment during the first 6 month. I have seen project
> > > written in VB and VC. I know the difference it make. Don't let
> > > Microsoft wash your brain. They are only good and Marketing and hypeing
> > > the shit out of a product. MacOS is much superior then Win97. Se ya
> > Wait a min. If you say UNIX 6 VS NT 4.1 then I would agree.
------------------------------
Date: 23 Apr 1997 16:41:44 -0400
From: Mike Campbell <mcampbel@tvmaster.turner.com>
Subject: Re: why cant I access/print a list-of-lists this way
Message-Id: <r52081mpyv.fsf@tvmaster.turner.com>
Ronald.J.Kimball@dartmouth.edu (Chipmunk) writes:
> For this one $,=" " so that it prints a space between each element:
>
> print (@{ $B[$l] });
You can rely on the semi-magic "print spaces between array elements
when printing an array in a string" behavior too:
print "@{ $B[$l] }";
------------------------------
Date: Wed, 23 Apr 1997 13:40:25 -0700
From: Greg <greg@skokie.com>
Subject: www-based e-mail
Message-Id: <335E73B9.412B@skokie.com>
did you guys see the www.usa.net page or hotmail.com?
i want to put that www-based e-mail on my server... i did couple of
pages all non-profit, and i would like my visitors to communicate with
me somehow, but some of them don't have e-mail accounts (well, yes, they
can send me e-mail but i can't reply to it ;-) )
do you know of any location on the web, or do you have a script that
does that? if not, do you have any suggestions on how to write one? i'm
sort of a beginner in perl ;-)
thank you for your help!
greg
--
Greg --- WebMaster ---
__ __ _ _ _ WebTech Designers
/ / /\ \ \___| |__ | |_ ___ ___| |__
--------------------------------
\ \/ \/ / _ \ '_ \| __/ _ \/ __| '_ \ | Pager/Voice : (312)295-3426
|
\ /\ / __/ |_) | || __/ (__| | | | | e-mail: greg@skokie.com
|
\/ \/ \___|_.__/ \__\___|\___|_| |_| | http://www.skokie.com/greg
|
-------------------------------------------------------------------------
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
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 357
*************************************