[13470] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 880 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 22 18:17:21 1999

Date: Wed, 22 Sep 1999 15:10:20 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <938038220-v9-i880@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 22 Sep 1999     Volume: 9 Number: 880

Today's topics:
    Re: problem with the UNIX sum checksum command and unpa <gellyfish@gellyfish.com>
    Re: Regex and my <joeyandsherry@mindspring.com>
    Re: Regex and my <joeyandsherry@mindspring.com>
    Re: Remove %20 <gellyfish@gellyfish.com>
    Re: REQ: tell-a-friend script <cassell@mail.cor.epa.gov>
    Re: Slow runtime - a problem with my server? (Abigail)
    Re: sort depth (Kragen Sitaker)
    Re: sorting like numbers an array of strings <cassell@mail.cor.epa.gov>
    Re: stripping newlines out of a string (Abigail)
    Re: stripping newlines out of a string (Michael Stevens)
    Re: System call in windows (Michael Stevens)
    Re: System call in windows <gellyfish@gellyfish.com>
    Re: target frame in URL redirection (Michael Stevens)
    Re: Test regex (Ilya Zakharevich)
    Re: unsafe pipe opens (was:Some e-mails get sent, some  (Michael Stevens)
    Re: where to write perl??? <garyg@gator.net>
    Re: where to write perl??? <elaine@chaos.wustl.edu>
    Re: where to write perl??? <camerond@mail.uca.edu>
    Re: You should be admired <cassell@mail.cor.epa.gov>
    Re: You should be admired (Abigail)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 22 Sep 1999 21:05:00 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: problem with the UNIX sum checksum command and unpack
Message-Id: <7sbg9s$85b$1@gellyfish.btinternet.com>

On Wed, 22 Sep 1999 15:26:29 GMT Kragen Sitaker wrote:
> In article <37E8F250.832627CC@chaos.wustl.edu>,
> Elaine -HFB- Ashton  <elaine@chaos.wustl.edu> wrote:
>>> cryptographically-strong hash function like MD5 or SHA-1.  Some
>>> versions of Unix come with a program called md5sum or something
>>> similar.
>>
>>Yes, it's md5sum.
> 
> Well, it's md5sum on my Cygwin32 box; someone else posted that it was
> called md5 on their FreeBSD box.

md5sum is the GNU program - it may be called other things where the code
is from another source as on *BSD ...

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


------------------------------

Date: Wed, 22 Sep 1999 16:37:43 -0400
From: <joeyandsherry@mindspring.com>
Subject: Re: Regex and my
Message-Id: <7sbeqi$q6k$1@nntp4.atl.mindspring.net>

Thanks!




------------------------------

Date: Wed, 22 Sep 1999 16:37:53 -0400
From: <joeyandsherry@mindspring.com>
Subject: Re: Regex and my
Message-Id: <7sbeqs$vtr$1@nntp4.atl.mindspring.net>

Thanks!




------------------------------

Date: 22 Sep 1999 20:07:11 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Remove %20
Message-Id: <7sbctf$59o$1@gellyfish.btinternet.com>

On Wed, 22 Sep 1999 17:29:04 +0200 E.G. van Haandel wrote:
> Hello,
> 
> When I try to send a variable (with a space) to a perl-script, the space is
> changed to %20. How can I remove the %20 from the variable?
> 

Did you think why this is happening ?  Have you tried data with other
characters than simply [A-Za-z0-9 ] ?  What about æçôùèêèäæùçíöæçèë for 
instance ?

I would suggest:

<http://hoohoo.ncsa.uiuc.edu/cgi>

in the first place.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


------------------------------

Date: Wed, 22 Sep 1999 13:40:23 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: REQ: tell-a-friend script
Message-Id: <37E93EB7.F2A99339@mail.cor.epa.gov>

Tom Christiansen wrote:
> 
> In comp.lang.perl.misc, planb@newsreaders.com (J. Moreno) writes:
> :But we don't speak just english -- we speak various computer
> :jargons too; and elseif is the correct and natural spelling.
> 
> You are quite simply, wrong.  We're speaking Perl.  Learn it.  Next you'll
> be telling us that "last" is a type for "break".

Or even a typo for "break".

> If someone tells you that "departement" is the correct spelling for the
> word in French, you don't tell them that the second "e" is misspelled.

Why not?  Everyone in this ng does.  :-)
 
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


------------------------------

Date: 22 Sep 1999 16:01:29 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Slow runtime - a problem with my server?
Message-Id: <slrn7uih21.e5i.abigail@alexandra.delanet.com>

Christopher Woods (ccwoods1@antiquebottlesdot.net) wrote on MMCCXIII
September MCMXCIII in <URL:news:37E90329.3CC7@antiquebottlesdot.net>:
"" 
"" I have been testing a perl cgi script to send a mailform.  It is simple
"" program that worked great on the website where I downloaded it from.
"" 
"" I have installed it on my web host's server cgi-bin and it works fine,
"" but it takes 35 to 50 seconds to submit the form!
"" 
"" Is this a problem with my server, did I somehow configure the script
"" incorrectly, or ??  There is no verification of the email format....this
"" should be a simple quick task.  I have tried a few similar scripts on my
"" server, and they all take 30 to 60 seconds to submit the form.


Hmm, yeah, there might be something wrong. Or not. Who knows? Perhaps
the website you downloaded it from was an E10k, doing nothing else,
and the one you installed it on was an overworked 486 running something
Microsoftish.



Abigail
-- 
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
         / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / 
         % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
         BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


------------------------------

Date: Wed, 22 Sep 1999 20:20:18 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: sort depth
Message-Id: <6SaG3.3704$QJ.217947@typ11.nn.bcandid.com>

In article <x3y1zbq7sta.fsf@tigre.matrox.com>,
Ala Qumsieh  <aqumsieh@matrox.com> wrote:
>Wise Guy <WiseGuy_73NOcdSPAM@go.com> writes:
>> I tried this out ___ it gives me 13 digits after the 
>> decimal point in the format x.xxxxxxxxxxxxxe+n ... where 
>> e+n is 10 to the corresponding power. This is if u tell 
>> Perl to treat the lines as numbers. If however, u enclose 
>> these in quotes, u will get the desired output :-)
>
>You mean lexicographic sorting which would sort 2000 ahead of 300 ?

Lexicographic sorting will, indeed, sort "2000" ahead of "300".
However, it will sort " 300" ahead of "2000".  This is why
right-justifying numeric fields is a Good Thing.

-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Wed Sep 22 1999
47 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


------------------------------

Date: Wed, 22 Sep 1999 13:30:02 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: sorting like numbers an array of strings
Message-Id: <37E93C4A.A8E0E26B@mail.cor.epa.gov>

Sean McAfee wrote:
[el snippo]
> @sorted =
>         map  { $_->[0] }
>         sort { $a->[1] <=> $b->[1] or $a->[2] <=> $b->[2] }
>         map  { [ $_, (split /\s*,\s*/)[0,1] ] } @my_array;
> 
> To really understand how it works you'll need to learn about references (if
> you haven't already).  They're described in the perlref manpage.

And as a further note related to the original poster's
request, in the sort routine the fields are being transparently
changed into numbers for comparison via the <=> operator,
just as requested.

Just trying to clarify a point,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


------------------------------

Date: 22 Sep 1999 15:34:52 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: stripping newlines out of a string
Message-Id: <slrn7uifg5.e5i.abigail@alexandra.delanet.com>

Kragen Sitaker (kragen@dnaco.net) wrote on MMCCXIII September MCMXCIII in
<URL:news:Ig4G3.3143$QJ.171857@typ11.nn.bcandid.com>:
~~ In article <slrn7uh7ui.db6.abigail@alexandra.delanet.com>,
~~ Abigail <abigail@delanet.com> wrote:
~~ >Quinn Coldiron (qcoldiro@thetoolhouse.com) wrote on MMCCXIII September
~~ >MCMXCIII in <URL:news:37E84332.87D6A2E9@thetoolhouse.com>:
~~ ><> I'm on RedHat 6.0 and am trying to write a Perl script that will strip
~~ ><> the newline character out of a string.  Any help?
~~ >
~~ >Hint: the Linux distribution your are using is irrelevant.
~~ 
~~ Unless you're trying to install AnyDBM.  :)


*boggle*


Why would you install AnyDBM if you want to strip out newline characters?



Abigail
-- 
If I quote an article it's to provide context. Read the context.


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


------------------------------

Date: 22 Sep 1999 20:35:01 GMT
From: mstevens@ashre.demon.co.uk (Michael Stevens)
Subject: Re: stripping newlines out of a string
Message-Id: <slrn7uifbl.kd.mstevens@swirl.internal.fict>

On Wed, 22 Sep 1999 12:50:48 GMT, Kragen Sitaker <kragen@dnaco.net> wrote:
>In article <slrn7uh7ui.db6.abigail@alexandra.delanet.com>,
>Abigail <abigail@delanet.com> wrote:
>>Quinn Coldiron (qcoldiro@thetoolhouse.com) wrote on MMCCXIII September
>>MCMXCIII in <URL:news:37E84332.87D6A2E9@thetoolhouse.com>:
>><> I'm on RedHat 6.0 and am trying to write a Perl script that will strip
>><> the newline character out of a string.  Any help?
>>Hint: the Linux distribution your are using is irrelevant.
>Unless you're trying to install AnyDBM.  :)

Or if you're on a distribution with a broken perl install, as I
believe has been known to happen.


------------------------------

Date: 22 Sep 1999 20:36:53 GMT
From: mstevens@ashre.demon.co.uk (Michael Stevens)
Subject: Re: System call in windows
Message-Id: <slrn7uiff5.kd.mstevens@swirl.internal.fict>

On Wed, 22 Sep 1999 09:58:35 -0700, Harish <hdeshpandeNOvrSPAM@carlson.com> wrote:
>Hi,
>   The call to 'system('explorer.exe")' returns immediately 
>eventhough 'explorer' is still running.  'system' I thought 
>was a blocking call.  How can one achieve this.
>Thanks in advance and good day.

On unix systems, 'system' blocks until the process started by it
returns. However, if the process it starts forks and exits, system
will return, as the process you started exited, even though
there is still a subprocess present.

I'm guessing explorer is doing something similar to allow for
people starting it in dos shell sessions under windows. If this is
the case, you can't achieve it easily, although one of the people
here may be able to come up with something.


------------------------------

Date: 22 Sep 1999 20:27:05 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: System call in windows
Message-Id: <7sbe2p$59r$1@gellyfish.btinternet.com>

On Wed, 22 Sep 1999 09:58:35 -0700 Harish wrote:
> Hi,
> 
>    The call to 'system('explorer.exe")' returns immediately 
> eventhough 'explorer' is still running.  'system' I thought 
> was a blocking call.  How can one achieve this.
> 

I dont know how you would achieve this, but the behaviour you describe
is what is expected - the same thing will happen if you run explorer
from a DOS window. 

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


------------------------------

Date: 22 Sep 1999 20:38:17 GMT
From: mstevens@ashre.demon.co.uk (Michael Stevens)
Subject: Re: target frame in URL redirection
Message-Id: <slrn7uifhp.kd.mstevens@swirl.internal.fict>

On Wed, 22 Sep 1999 12:39:16 -0400, HHH <hartleh1@westat.com> wrote:
>Next, I should point out that while this may not be part of the HTTP
>standard, the original poster did not ask for a complete solution that
>will always work and conforms to all appropriate standards.  The

I'm not sure about the rest of the group but I tend to think of
this as an implict request when any question is asked. Unless they
specifically say 'I want a non-portable answer that is non standard
and will break some of the time'...


------------------------------

Date: 22 Sep 1999 22:00:42 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Test regex
Message-Id: <7sbjia$j99$1@charm.magnus.acs.ohio-state.edu>

[A complimentary Cc of this posting was sent to Eli the Bearded 
<*@qz.to>],
who wrote in article <eli$9909221246@qz.little-neck.ny.us>:
> In comp.lang.perl.misc, Samay  <samay1NOxoSPAM@hotmail.com> wrote:
> > Second takes far less than the first..
> > Anyone can find out?
> > 
> > perl -e '"OReilly and The Perl Conference" =~ /i(.+)+i/' 
> > 
> > perl -e '"OReilly and The Perl Conference" =~ /i(.+)+e/' 
> 
> 
> Easy to see why if you enable DEBUGGING in your perl and
> add the option '-D520'.

No need for this starting from 5.005.  Just -Mre=debugcolor.

Ilya


------------------------------

Date: 22 Sep 1999 20:33:36 GMT
From: mstevens@ashre.demon.co.uk (Michael Stevens)
Subject: Re: unsafe pipe opens (was:Some e-mails get sent, some don't)
Message-Id: <slrn7uif90.kd.mstevens@swirl.internal.fict>

On Wed, 22 Sep 1999 05:58:23 -0700, Bill Moseley <moseley@best.com> wrote:
>   $query =~ tr/'/ /; 
>   open(PROG, "$prog -s ' $query ' -d $database|") or die $!;
>Which is an easy enough modification that they might actually make 
>the change.
>Yes, yes, I know a pipe & exec is safer, or that I should only allow 
>'safe' characters in (one application needs to be able to pass 
>punctuation chars, for example).  But I'm wondering about this hack to 
>use in the mean time.
>I can't see how to backslash out of that, and I don't know the shell 
>well enough to know if any other characters that have special meaning 
>within single quotes.  What has my tired old brain missed this time?

The generally preferred way to do this is not to remove bad characters,
but to pass only allowed ones, in my opinion. I'd also suggest reading
the sh(1) page to see what stuff it considers special.

And on a real-world level, put your concerns in writing and ensure
that everyone important has seen them.


------------------------------

Date: Wed, 22 Sep 1999 16:45:20 -0400
From: "Gary M. Greenberg" <garyg@gator.net>
Subject: Re: where to write perl???
Message-Id: <37E93FE0.F974C189@gator.net>

Andy Huang wrote:
> 
> when i write C/C++ , i use either Borland or microsoft compiler, but i never
> see any compiler for perl, some one told me develop it under win32, but it
> is going to be extremely difficult without any editor's help.  Some one tell
> me to install linux, but i have tried so many times to install linux and
> failed, please tell me a easiet way to develop perl thanx man.

I like to write Perl at home and at work but usually not at parties.

On windoze, I use either PFE or vi; on Solaris, I use typically use
vi or texteditor.
I run perl scripts any damn where it makes sense ;-)

I really like the new Perl CD Bookshelf as a reference as well as for
continuing to increase my Perl knowledge. And, www.bookpool.com has a
great price (we got 2 CDs w/ Perl in a Nutshell for less than $80.00
delivered!)

Gary
            -=-  Avenue Programmers' Reference  -=-
   Class Hierarchy, Requests, and Hyperlinked Sample Scripts:
	     http:/www.gator.net/~garyg/aveclass.htm


------------------------------

Date: Wed, 22 Sep 1999 17:13:39 -0400
From: Elaine -HFB- Ashton <elaine@chaos.wustl.edu>
Subject: Re: where to write perl???
Message-Id: <37E945E2.FD1D93DF@chaos.wustl.edu>

"Gary M. Greenberg" wrote:
> I like to write Perl at home and at work but usually not at parties.

Sounds like you need to find your local Perl Mongers group to round out
your life. :)

e.


------------------------------

Date: Wed, 22 Sep 1999 16:32:58 -0500
From: Cameron Dorey <camerond@mail.uca.edu>
Subject: Re: where to write perl???
Message-Id: <37E94B0A.6EA30D6@mail.uca.edu>

"Gary M. Greenberg" wrote:
> 
> [snip]
> I really like the new Perl CD Bookshelf as a reference as well as for
> continuing to increase my Perl knowledge. And, www.bookpool.com has a
> great price (we got 2 CDs w/ Perl in a Nutshell for less than $80.00
> delivered!)

This should be a great set, but this is a "great price"? List price from
ORA is $59.95 ($66.45 w/UPS ground shipping). You must either be one of
those who demands same-day delivery or live really way out in the
boonies. Perhaps your fingers slipped on the keys?

Cameron

-- 
Cameron Dorey
Associate Professor of Chemistry
University of Central Arkansas
Phone: 501-450-5938
camerond@mail.uca.edu


------------------------------

Date: Wed, 22 Sep 1999 13:38:29 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: You should be admired
Message-Id: <37E93E45.8EA1E2FE@mail.cor.epa.gov>

Henry Penninkilampi wrote:
> 
> People, settle!

I am settling.  Mostly around my waistline.

[snip of Javascript answer]
> In my book, it's OK to make a mistake *once* and we should all exercise a
> little bit of patience when newbies pose questions.  Venomous attacks are
> possibly best reserved for those that *repeatedly* demonstrate their lack
> of research skills, don't you think?

Yes.  I agree.  That is why I seldom flame new posters, even
when they ask totally off-topic questions.  I may sound a little
firm when responding, though.  But I do try to provide some
guidance.  Having a child of my own gives me that playground-
monitor tone.  :-)

But I feel differently about lurkers who contribute no useful
answers here, but just drop in with the standard "U SUK BECAUSE
U R MEAN!" rants.  Particularly when the ranter is so dead
wrong that even newbies point and cringe.

I'm happy to let others deal with non-Perl questions, particularly
if they also explain in their reply that the question would get
a better answer in newsgroup X or Y.  I am not willing to let
absurd attitudes about this newsgroup stand uncontested, since
that can only contribute to more off-topic questions at a later
date. ["Why not?  J Random Luser said last week that it was okay
and no one disagreed..."]  And then, when the arguments go
_ad_hominem_ ...

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


------------------------------

Date: 22 Sep 1999 15:38:24 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: You should be admired
Message-Id: <slrn7uifmp.e5i.abigail@alexandra.delanet.com>

Henry Penninkilampi (spamfree@metropolis.net.au) wrote on MMCCXIII
September MCMXCIII in <URL:news:spamfree-2309990419210001@d6.metropolis.net.au>:
## People, settle!
## 
## The answer to the original question is:
## 
## <A HREF="javascript:document.forms['myForm'].submit();">Make it so!</A>
## 
## Now, that wasn't too painful, was it?

perl -w
<A HREF="javascript:document.forms['myForm'].submit();">Make it so!</A>
__END__

Hmm, that didn't compile.

## In my book, it's OK to make a mistake *once* and we should all exercise a
## little bit of patience when newbies pose questions.  Venomous attacks are
## possibly best reserved for those that *repeatedly* demonstrate their lack
## of research skills, don't you think?


No. You're a whiner.


*plonk*



Abigail
-- 
echo "==== ======= ==== ======"|perl -pes/=/J/|perl -pes/==/us/|perl -pes/=/t/\
 |perl -pes/=/A/|perl -pes/=/n/|perl -pes/=/o/|perl -pes/==/th/|perl -pes/=/e/\
 |perl -pes/=/r/|perl -pes/=/P/|perl -pes/=/e/|perl -pes/==/rl/|perl -pes/=/H/\
 |perl -pes/=/a/|perl -pes/=/c/|perl -pes/=/k/|perl -pes/==/er/|perl -pes/=/./;


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


------------------------------

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 880
*************************************


home help back first fref pref prev next nref lref last post