[13148] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 558 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Aug 16 20:07:19 1999

Date: Mon, 16 Aug 1999 17:05:13 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 16 Aug 1999     Volume: 9 Number: 558

Today's topics:
    Re: Active state perl and IIS3 mixed asp/perl environme <cassell@mail.cor.epa.gov>
    Re: CGI.pm or here document for html <mshenoy@us.oracle.com>
    Re: CGI.pm or here document for html support@gethits.com
    Re: Counting lines of block of text <mshenoy@us.oracle.com>
    Re: Counting lines of block of text <mcking@cajunbro.com>
    Re: Counting lines of block of text <cassell@mail.cor.epa.gov>
    Re: Counting lines of block of text <cassell@mail.cor.epa.gov>
    Re: determining a leap year (Martien Verbruggen)
    Re: HARASSMENT -- Monthly Autoemail feinster@my-deja.com
    Re: HARASSMENT -- Monthly Autoemail <uri@sysarch.com>
        Killing Processes on NT... <mshenoy@us.oracle.com>
    Re: launching applications (elephant)
    Re: Multi-Page Forms (Filip M. Gieszczykiewicz)
    Re: Pattern matching and extracting data <All@n.due.net>
        pattern matching <bjlockie@nortelnetworks.com>
    Re: Perl + Tcl in same module <a.kupries@westend.com>
    Re: Perl Compiler for Solaris 2.7? (Martien Verbruggen)
        PERL jobs emilym4444@my-deja.com
    Re: Perl Services <emschwar@rmi.net>
    Re: Perl Services <elaine@chaos.wustl.edu>
    Re: Perl Services <revjack@radix.net>
    Re: s/// and interpolation <cassell@mail.cor.epa.gov>
    Re: sorting arrays <makkulka@cisco.REMOVETHIS.com>
    Re: sorting arrays (Larry Rosler)
    Re: sorting arrays <Joe.Kline@sdrc.com>
    Re: spawning multiple processes in perl win32 <cassell@mail.cor.epa.gov>
    Re: Static variables <james.p.williams@usahq.unitedspacealliance.com>
    Re: statistical sorts <cassell@mail.cor.epa.gov>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Mon, 16 Aug 1999 16:44:43 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Active state perl and IIS3 mixed asp/perl environment
Message-Id: <37B8A26B.26C715B4@mail.cor.epa.gov>

Maurice Walshe wrote:
[snip]
> That will be the perl32 faq that is missing from perl.com then :-)

But you can get it at www.activestate.com - it comes along with
the ActiveState Perl install.
 
> However the problem is in the asp/perl interaction more than
> perl itself - Late last week I did some timeing tests and
> the problem is not with perl but with (guess what) the ASP Spit ;-(

Perhaps the mailing list for win32 Perl web users at
http://www.activestate.com/support/mailing_lists.htm
might be of more help.

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


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

Date: Mon, 16 Aug 1999 18:42:42 -0400
From: Manoj Shenoy <mshenoy@us.oracle.com>
To: support@gethits.com
Subject: Re: CGI.pm or here document for html
Message-Id: <37B893E2.E9E19911@us.oracle.com>


  Hi Darryl, I deal with the PERL CGI module pretty much every day.  Its
really pretty convenient I've found.  I used to do it the old way before
with the DOCTYPEs and the EOF and end EOFs.  Its really much much better
to use CGI.pm.  For example you no longer need to break up your HTML and
PERL code anymore.  And its been simplified for you.  Here's a quick
example:

#!/usr/local/bin/perl -w
use CGI qw(:all);

print header;   # in place of DOCTYPE stuff
print start_html("My Home Page");  # in place of <HTML><HEAD><TITLE>My
Home Page</TITLE></HEAD><BODY>
$stuff = param ('STUFF');   # get form variables passed in from previous
page
print "<CENTER>Hi Manoj</CENTER>";  # in place of breaking up HTML code
and PERL code.
print end_html;  # in place of </BODY></HTML>

Its just much nicer and one of the biggest advantages is you can now
debug your CGI programs from the command line, hope that helps...Manoj

support@gethits.com wrote:

> I've been using here documents for html in my perl
> scripts which has been pretty convenient and
> malleable in the past. I'm considering converting
> to CGI.pm to generate web documents, but I'm
> wondering if it's worth it. The textbooks say its
> great, but does anybody have some real world
> experience with using CGI.pm for this purpose?
> If so, why is it better?
>
> Thanks,
> Darryl Dyck



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

Date: Mon, 16 Aug 1999 23:12:20 GMT
From: support@gethits.com
Subject: Re: CGI.pm or here document for html
Message-Id: <37B89C70.DC28B1EE@gethits.com>

Manoj Shenoy wrote:
For example you no longer need to break up your HTML and
> PERL code anymore.  And its been simplified for you.  Here's a quick
> example:
> 
> #!/usr/local/bin/perl -w
> use CGI qw(:all);
> 
> print header;   # in place of DOCTYPE stuff
> print start_html("My Home Page");  # in place of <HTML><HEAD><TITLE>My
> Home Page</TITLE></HEAD><BODY>
> $stuff = param ('STUFF');   # get form variables passed in from previous
> page
> print "<CENTER>Hi Manoj</CENTER>";  # in place of breaking up HTML code
> and PERL code.
> print end_html;  # in place of </BODY></HTML>
> 
> Its just much nicer and one of the biggest advantages is you can now
> debug your CGI programs from the command line, hope that helps...Manoj
> 

Thanks for your advise and the code example; I guess what I'm
really trying to find out is how CGI.pm is going to handle more
complex html/javascipt code. For example, how would (or could) the 
following sample code be done with CGI.pm:
 ...
print <<"EOF";
<BODY BGCOLOR="#FFFFFF" ONLOAD="window.defaultStatus=''">
<DIV ALIGN="center">
<!-- Main button -->
<A HREF="day3-3_sel.html"
 ONMOUSEOVER="document.mainImg.src=main_shad.src; window.status='Home
Page'; return true"
 ONMOUSEOUT="document.mainImg.src=main.src">
<IMG SRC="main.gif" NAME="mainImg" BORDER="0" WIDTH="386"
 HEIGHT="107"></A>
</DIV>
</BODY>
EOF
 ...

Darryl Dyck


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

Date: Mon, 16 Aug 1999 18:30:00 -0400
From: Manoj Shenoy <mshenoy@us.oracle.com>
To: "D. Stuart" <dstu@u.washington.edu>
Subject: Re: Counting lines of block of text
Message-Id: <37B890E8.847EE921@us.oracle.com>


  Hi Derek, if I understand your question correctly basically all you're
trying to do is find out the size of the array you have?  If that's it all you
need to do is $#text . This will give you the last element in the array.  Add
1 to it and you have the array size.  I hope that helps...Manoj

D. Stuart wrote:

> I am a novice perl user, so my problem is probably elementary.
>
> I have a program that returns a block of text.
> Currently I am assigning that to an array "@text".  I'd like to be able to
> count the number of lines of text that I have.  I know how to do this when
> reading in a file... but not when it isn't a file.
>
> What is a simple way to do this?
>
> Thanks in advance,
>
> Derek Stuart
> UofWashington



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

Date: Mon, 16 Aug 1999 23:14:05 +0000
From: Mark McCoy <mcking@cajunbro.com>
Subject: Re: Counting lines of block of text
Message-Id: <37B89B3D.60E2D0E@cajunbro.com>

"D. Stuart" wrote:
> 
> I am a novice perl user, so my problem is probably elementary.
> 
> I have a program that returns a block of text.
> Currently I am assigning that to an array "@text".  I'd like to be able to
> count the number of lines of text that I have.  I know how to do this when
> reading in a file... but not when it isn't a file.
> 
> What is a simple way to do this?
> 
> Thanks in advance,
> 
> Derek Stuart
> UofWashington


From "man perldata":
------start here------
The length of an array is a scalar value.  You may find
the length of array @days by evaluating $#days, as in csh.
(Actually, it's not the length of the array, it's the
subscript of the last element, because there is
(ordinarily) a 0th element.)
------stop here------
you can also use "scalar(@array)", which does just what $#array does, evaluates
the array in scalar context.

Most perl newbies look for a separate function to do this, or do it themselves
(the hard way) by iterating through the list, incrementing a temp variable.  I
assume you are doing something of this sort when you say you can do this when
reading from a file.  You can save a few clock cycles and a temp var by just
waiting till you are finished bulding your list and then setting
"$someArrayLength = $#linesFromFile;"


 
-- 
Mark McCoy -- Cajun Brothers Technology, llc
Proud to run Linux since February 1996
This message posted from snowdog, a 100% MS-free machine.
The views in this message do not necessarily reflect the views of my employer


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

Date: Mon, 16 Aug 1999 16:50:36 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Counting lines of block of text
Message-Id: <37B8A3CC.20C01317@mail.cor.epa.gov>

Manoj Shenoy wrote:
> 
>   Hi Derek, if I understand your question correctly basically all you're
> trying to do is find out the size of the array you have?  If that's it all you
> need to do is $#text . This will give you the last element in the array.  Add
> 1 to it and you have the array size.  I hope that helps...Manoj

But it is easier to get the size of the array like this:

$num_of_elements = @text;

Then you don't have to muck around with $#text and keep checking
whether you have a one-off error in your code.

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


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

Date: Mon, 16 Aug 1999 16:53:28 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Counting lines of block of text
Message-Id: <37B8A478.F6D30A62@mail.cor.epa.gov>

Mark McCoy wrote:
[snip]
> From "man perldata":
[snip of quote]
> you can also use "scalar(@array)", which does just what $#array does, evaluates
> the array in scalar context.

Not quite, but close enough for government work.. as we like to
say around here.  :-)

> Most perl newbies look for a separate function to do this, or do it themselves
> (the hard way) by iterating through the list, incrementing a temp variable.  I
> assume you are doing something of this sort when you say you can do this when
> reading from a file.  You can save a few clock cycles and a temp var by just
> waiting till you are finished bulding your list and then setting
> "$someArrayLength = $#linesFromFile;

But that doesn't give the array length.  It is off by 1.
Your best bet is to just say:

$someArrayLength = @linesFromFile;

That gives you the number of elements in the array.  All you
have to do is use the array in scalar context, and let Perl
do the rest.

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


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

Date: Mon, 16 Aug 1999 23:55:21 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: determining a leap year
Message-Id: <Jx1u3.126$Dq2.3596@nsw.nnrp.telstra.net>

In article <37b81018.3893721@nntp.lucent.com>,
	lin.minnich@usa.net (Linda Minnich) writes:

\begin{offtopic}

> February 29. But the year 2000 will be a leap
> year, the first such century leap year since 1600. 

Except of course that that particular calendar has not always been in use.

\end{offtopic}

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | Make it idiot proof and someone will
Commercial Dynamics Pty. Ltd.       | make a better idiot.
NSW, Australia                      | 


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

Date: Mon, 16 Aug 1999 21:58:44 GMT
From: feinster@my-deja.com
Subject: Re: HARASSMENT -- Monthly Autoemail
Message-Id: <7pa1ie$q5e$1@nnrp1.deja.com>

I agree- those stupid emails are spam.  When I went looking for a good
perl book, I completely passed by everyone of those books with toms
name on it. I wouldnt pay a dime for any work he's done, in fact, I may
steal some just to rip him off, just because of his elitiest attitude
here on this ng. Of couse, he wont ever see this post, cause every one
using deja.com is deemed as an idiot and not worthy, and is
automatically in his killfile. Hey Tom- *plonk* THIS, buddy !!!!!

-the troll

In article <37B7E4B5.6D727879@strs.co.uk>,
  Ian Clarke <I.Clarke@strs.co.uk> wrote:
>
> > I apologize for the rather harsh tone my follow-up has taken.
> > But sometimes I get a mite peeved at the modern notion that
> > people ought to be allowed to behave in any anti-social manner
> > they like and that somehow anybody who attempts to correct their
> > behaviour is at fault.
>
> Sending a regular unsolicited email to someone, which has the clear
> intention to annoy rather than inform, IS a world apart from not
> following the letter of the law (and I use that word with all implied
> irony) regarding posting.
>
> Tom should grow up, and those defending him should show some backbone.
>
> Ian.
>


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 16 Aug 1999 18:17:27 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: HARASSMENT -- Monthly Autoemail
Message-Id: <x7672f2ww8.fsf@home.sysarch.com>

>>>>> "f" == feinster  <feinster@my-deja.com> writes:

  f> I agree- those stupid emails are spam.  When I went looking for a good
  f> perl book, I completely passed by everyone of those books with toms
  f> name on it. I wouldnt pay a dime for any work he's done, in fact, I may
  f> steal some just to rip him off, just because of his elitiest attitude
  f> here on this ng. Of couse, he wont ever see this post, cause every one
  f> using deja.com is deemed as an idiot and not worthy, and is
  f> automatically in his killfile. Hey Tom- *plonk* THIS, buddy !!!!!

  f> -the troll

well somebody has to buy "perl for trolls".

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


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

Date: Mon, 16 Aug 1999 18:23:22 -0400
From: Manoj Shenoy <mshenoy@us.oracle.com>
Subject: Killing Processes on NT...
Message-Id: <37B88F5A.F8611669@us.oracle.com>

Hi All, I seem to be facing a bit of a dillemma.  I am trying to kill
a PERL process on NT using the %SIG signal handler hash.  In this SIG
hash are many keys, some of the relevant ones include QUIT, BREAK, STOP,

INT, and KILL.  Basically here's what I am trying to accomplish.  I want

to send a kill signal from one program to another (both written in
PERL).  When the kill signal is received, I want the receiving program
to handle it by going to a subroutine, doing whatever I tell it do, and
then die.  So here is the signal receiving program code (I call it
loop.pl):

#!/usr/local/bin/perl -w
# loop.pl
print "The process id is $$ \n\n\n";

sub finishUp
{
 print "\n\n\nHi Manoj, I think this works!\n";
 die;
}

$SIG{QUIT} = \&finishUp;

$num = 100000000000000000;
print "Counting to $num ....\n\n";
for($i=0;$i<$num;$i++)
{
# just count so the program does not end
}

Only reason I'm counting to that outrageous number to keep the program
from ending before I kill it.  Now here is the sending signal program
code (I call it kill.pl):

#!/usr/local/bin/perl -w
#kill.pl
print "Attempting to kill process $ARGV[0]...";

kill QUIT => $ARGV[0];
print "\n";

ARGV[0] contains the process id of the receiving program which i send
from the command line.

Unfortunately on NT when i run loop.pl  and then kill its process
identifier from kill.pl all it does is die, it does not enter the
finishUp Subroutine to do what i want it do.  Interestingly enought on
Solaris it does do exactly what i want it to do.  Does anyone have any
idea why this may be?  It seems simple enough, is there something
special i have to do on NT?

Any help would really be greatly appreciated!!...Thanks...Manoj





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

Date: Tue, 17 Aug 1999 08:22:03 +1000
From: elephant@squirrelgroup.com (elephant)
Subject: Re: launching applications
Message-Id: <MPG.12233a1558fc3497989c31@news-server>

ceehsa1 (Helen Sian Ashton) writes ..
>I'm trying to use a perl script from a web browser to launch an application. I 
>can get the perl script to do everything I want to do if I run it from the DOS 
>window - I am using the system command to launch the application. However this 
>deosn't work when I run it from the browser, in fact everything but the system 
>command seems to work!
>
>I am using a Windows NT PC and have tried this in both Netscape and IE 
>browsers. The perl scripts are stored on a UNIX server.
>
>Can anyonw shed some light?

I see that Rick hasn't got to this one yet *B^) .. so allow me

see the FAQ "My CGI script runs from the command line but not the 
browser." in

  perldoc perlfaq9

found with

  perldoc -q "CGI.*command.?line"

-- 
 jason - elephant@squirrelgroup.com -


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

Date: 16 Aug 1999 23:47:19 GMT
From: fmgst+@pitt.edu (Filip M. Gieszczykiewicz)
Subject: Re: Multi-Page Forms
Message-Id: <7pa7u7$72j$1@usenet01.srv.cis.pitt.edu>

In Article <brian-ya02408000R1208990331210001@news.panix.com>, through puissant locution, brian@pm.org (brian d foy) soliloquized:
>In article <802qx@questionexchange.com>, QuestionExchange <USENET@questionexchange.com> posted:
>> Check out these web sites:
>> http://www.perl.org
>
>that site will be going away soon.

WHY???

And why does it ask for username/password now?

(and why isn't this mentioned on www.perl.com?)
-- 
Filip "I'll buy a vowel" Gieszczykiewicz  |  http://www.repairfaq.org/

                   Always and everything for the better!
 Now exploring whatever, life, and the meaning of it all... and 'not' :-)


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

Date: Mon, 16 Aug 1999 22:06:41 GMT
From: "Allan M. Due" <All@n.due.net>
Subject: Re: Pattern matching and extracting data
Message-Id: <RX%t3.15213$C6.154708@news2.rdc1.on.home.com>

"willow" <chettah@msn.com> wrote in message
news:jv_t3.3993$001.1929287@WReNphoon3...
: The lines all look like this:
: RP0401 99994028919519991013      +000002236.180000053
: RP0401 99998010127619991013      +000000010.420000002
: RP0404 91020000119619991013      -000000001.090000000
: RP0401 80400000120119991013      -000000014.320000000

Well, if that is the case you could do something like:

#!/usr/local/bin/perl -w
use strict;
my ($sum);
open (FH,'file.ext') or die "an ugly death because: $!";
while (<FH>) {
    $sum+= substr($_,33,20);
}
close (FH) or die "at the close of day: $!";
print "$sum\n";

Check out substr and unpack.

HTH

AmD
--
$email{'Allan M. Due'} = ' All@n.Due.net ';
--Random Quote--
And don't tell me there isn't one bit of difference between null and space,
because that's exactly how
much difference there is.  :-)
   Larry Wall in <10209@jpl-devvax.JPL.NASA.GOV>





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

Date: Mon, 16 Aug 1999 19:05:37 -0400
From: Bob Lockie <bjlockie@nortelnetworks.com>
Subject: pattern matching
Message-Id: <37B89941.29A237FA@nortelnetworks.com>


# 08/09/99 06:00:19  INFO, Processing for domain userid complete-Message
Sent.
    ($userid) = $line =~
/(\S*)\s*complete-Message\s*Sent\.$/;                  
    ($domain) = $line =~
/Processing\s*for\s*(\S*)/;                         

I need to parse the above but $domain always fails.


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

Date: 16 Aug 1999 21:58:45 +0200
From: Andreas Kupries <a.kupries@westend.com>
Subject: Re: Perl + Tcl in same module
Message-Id: <m3lnbbcxai.fsf@bluepeak.westend.com>


"Spiros J. Boucouris" <spiros@genericad.com> writes:
 
> Hello
> 
> Has anybody done this?

Yes, see minotaur at

	http://mini.net/pub/ts2/

-- 
Sincerely,
	Andreas Kupries <a.kupries@westend.com>
			<http://www.westend.com/~kupries/>
-------------------------------------------------------------------------------


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

Date: Mon, 16 Aug 1999 23:38:07 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Perl Compiler for Solaris 2.7?
Message-Id: <zh1u3.124$Dq2.3596@nsw.nnrp.telstra.net>

In article <7p9i2q$psk@dfw-ixnews11.ix.netcom.com>,
	"Snehanshu Shah" <s_shah@ix.netcom.com> writes:
> Hello,
> 
> Is there a perl compiler or source obfuscator for Perl
> on the Sun Solaris 2.7 platform?

# perldoc perlfaq3
     How can I hide the source for my Perl program?
[snip]
     How can I compile my Perl program into byte code or C?

> Also, does anyone know if the next major revision (5.6?)
> of Perl will have support built in for creating executable
> or 'C' code.

See http://www.perl.com/. The article about perl 5.6 there talks about
this.

Now... Which part of your question couldn't you easily have looked up?

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | I took an IQ test and the results were
Commercial Dynamics Pty. Ltd.       | negative.
NSW, Australia                      | 


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

Date: Mon, 16 Aug 1999 22:06:19 GMT
From: emilym4444@my-deja.com
Subject: PERL jobs
Message-Id: <7pa20k$qb3$1@nnrp1.deja.com>

I've been doing Perl (with CGI) for a while and I
think I am ready for a consulting instead of
a permanent job.  Other than the commercial
sites (DICE, NET-Temps) where can I find these
kind of jobs?


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 16 Aug 1999 17:05:16 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: Perl Services
Message-Id: <xkfvhafjphv.fsf@valdemar.col.hp.com>

brian@pm.org (brian d foy) writes:
> In article <m1k8qvv8gt.fsf@halfdome.holdit.com>, merlyn@stonehenge.com (Randal L. Schwartz) wrote:
> >The first program I looked at contained the following in the first few
> >lines:
> >
> >    print "Content-type:text/html\n\n";
> 
> what did you not particularly like about that?

At a guess, the missing space after the :.

-=Eric


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

Date: Mon, 16 Aug 1999 19:24:44 -0400
From: Elaine -HFB- Ashton <elaine@chaos.wustl.edu>
Subject: Re: Perl Services
Message-Id: <37B89DB8.B89910C6@chaos.wustl.edu>

brian d foy wrote:
> because it's a customer support nightmare.  been there, done that.
> why do you think Matt Wright stopped supporting his stuff in the
> first place?  even if he could program well, he would still have
> a customer support problem.  i considered it morally wrong to
> provide software that you won't be able to support.

Well, we have the choice of bitching about MW or creating something
within the community to promote good CGI code. I think that is worth a
bit of work to build.

> however, CRAP is taking the lead on this.  wish i had the URL handy,
> but just look for recent posts with CRAP in the subject line.  i've
> offered Jeff free web hosting et cetera.

I thought Jeff was focusing mostly on MW scripts....well, the idea I had
was to make a nice site to promote the finished code with the
cooperation and support of both CRAP and CPAN. 

I'm just tossing out ideas with an offer of a resource that's up 24/7
and reliable. It's an excellent alternative to MW rants...besides...this
is _excellent_ advocacy. IMONSHO. :)

e.


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

Date: 16 Aug 1999 23:47:45 GMT
From: revjack <revjack@radix.net>
Subject: Re: Perl Services
Message-Id: <7pa7v1$kff$1@news1.Radix.Net>
Keywords: Hexapodia as the key insight

Eric The Read explains it all:
:brian@pm.org (brian d foy) writes:
:> In article <m1k8qvv8gt.fsf@halfdome.holdit.com>, merlyn@stonehenge.com (Randal L. Schwartz) wrote:
:> >The first program I looked at contained the following in the first few
:> >lines:
:> >
:> >    print "Content-type:text/html\n\n";
:> 
:> what did you not particularly like about that?

:At a guess, the missing space after the :.

This has always puzzled me. Where in the RFC(s) is it indicated that that
space is mandatory? I always use it, and if I send a header without it,
the server seems to compensate and actually insert it before sending the
header to the client (at least, Apache and Netscape servers seem to do
this).


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

Date: Mon, 16 Aug 1999 16:48:34 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: s/// and interpolation
Message-Id: <37B8A352.BBFA5970@mail.cor.epa.gov>

Christopher Conway wrote:
[snip]
> I apologize for attributing a FAQ to perlre. I couldn't
> get to perlre this morning (perl.org is asking for a
> login) and the FAQ was relevant (not relevant enough)
> to the question.

Don't keep doing this the hard way.  Get all the docs onto
your hard drive just by installing Perl on your own machine.
Go to www.activestate.com [you are on an NT machine as of
your current post] and get build 518 of ActiveState Perl.
Then let it install itself.  You'll have all the docs and
FAQs and module info sitting on your Start Menu, all ready
to pop up in your favorite browser.

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


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

Date: Mon, 16 Aug 1999 15:32:27 -0700
From: Makarand Kulkarni <makkulka@cisco.REMOVETHIS.com>
Subject: Re: sorting arrays
Message-Id: <37B8917B.67B78B75@cisco.REMOVETHIS.com>

mikej wrote:

> sub alphabetically {$a cmp $b}

Sort sorts lexically by default. You do not need a alphabetically ()
function
to do this.  For more information lookup perldoc -f sort.



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

Date: Mon, 16 Aug 1999 15:57:22 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: sorting arrays
Message-Id: <MPG.1222372f6cbc2bc9989e60@nntp.hpl.hp.com>

In article <37B8917B.67B78B75@cisco.REMOVETHIS.com> on Mon, 16 Aug 1999 
15:32:27 -0700, Makarand Kulkarni <makkulka@cisco.REMOVETHIS.com> 
says...
> mikej wrote:
> 
> > sub alphabetically {$a cmp $b}
> 
> Sort sorts lexically by default. You do not need a alphabetically ()
> function
> to do this.  For more information lookup perldoc -f sort.

Yes, that's true.  But as it doesn't change the behavior of the program, 
it is irrelevant to solving the reported problem.

Which I can't solve either, because it all seems legit to me!

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Mon, 16 Aug 1999 19:01:17 -0400
From: Joe Kline <Joe.Kline@sdrc.com>
To: mikej <mikej@1185design.com>
Subject: Re: sorting arrays
Message-Id: <37B8983C.99E17628@sdrc.com>

<< Courtesy email cc'd to sender >>

mikej wrote:

> Hi,
>
> I want to read in a list of names from an external file, and then sort
> this list alphabetically. I was able to do it when I specified the array
> in the script itself but  there is a problem when I try to define the
> array from an external file. Here is the script I have:
>
>
> open(STATS, "client.log") || &error("Couldn't open client log file
> \n\n$!");
> @indata = <STATS>;
> close(STATS);
>
> sub alphabetically {$a cmp $b}
>
> @sorted = sort alphabetically @indata;

<SNIP>

from perldoc -f sort:

Examples:

    # sort lexically
    @articles = sort @files;

    # same thing, but with explicit sort routine
    @articles = sort {$a cmp $b} @files;

Applying it to your code example (untested):

@sorted = sort { $a cmp $b } @indata;

Your code example should work, but the above snippet is just as effective
(and less typing ) and just as clear as your snippet.


You may want chomp you @indata list. That will remove any newlines in your
elements. That may or may not help.


HTH,

joe


--

/===================================================\
| Joe Kline                       | I used to be    |
|                                 | anonymous - Anon|
\===================================================/





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

Date: Mon, 16 Aug 1999 16:45:28 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: spawning multiple processes in perl win32
Message-Id: <37B8A298.DBB4D168@mail.cor.epa.gov>

mbowser@my-deja.com wrote:
> 
> I have created several perl scripts used to load test a database and
> webserver. I have to move the code from unix to win32 (NT) and cannot
> get the scripts to run because win32 doesn't support the Fork process I
> used on the unix box.  I found a reference to Win32::Spawn in
> O'Reilly's Perl in a Nutshell, but I can't get it to run. I can't find
> any documentation on this module. Is there another way to execute
> multiple processes at the same time on Win32?

You might also check out the Win32::Process::Create module
which comes with ActiveState's Perl.

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


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

Date: Mon, 16 Aug 1999 22:09:50 GMT
From: Jim Williams <james.p.williams@usahq.unitedspacealliance.com>
Subject: Re: Static variables
Message-Id: <7pa276$qjb$1@nnrp1.deja.com>

In article <37b8727e.0@news.provo.novell.com>,
  "Cory W. Aitchison" <caitchison@novell.com> wrote:
> I have created a function that needs a static variable.

Good guess.  That's how the perlsub man page recommends doing it.  The
only thing it adds is making the outer block a BEGIN {} block to ensure
it gets executed before your program starts to run.

Jim Williams


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Mon, 16 Aug 1999 16:42:55 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: statistical sorts
Message-Id: <37B8A1FF.6AC600CB@mail.cor.epa.gov>

Marc Grober wrote:
> 
> I am looking for a way to sort a population into arbitrarily sized
> groups so that the distribuition of a characteristic in the full
> population is the same as in the sample groups.  I have looked at CPAN's
> stat modules and was really looking for somethingat a higher level in
> that I am sure there must be code like this already in use.

Excuse me?  I'm sorry, but I really don't know what you're
asking.  Distributions of population parameters don't have
much to do with sorting.  Perl does have lots of ways to
sort, and a number of modules on statistical stuff.  But I
don't know what you're after.

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


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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 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.  

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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu. 

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 558
*************************************


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