[24305] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6496 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 30 21:06:00 2004

Date: Fri, 30 Apr 2004 18:05:09 -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           Fri, 30 Apr 2004     Volume: 10 Number: 6496

Today's topics:
        Books online???? <***************>
    Re: CGI.pm Escaping query strings - ampersand issue <gnari@simnet.is>
    Re: comparing decimal numbers <tadmc@augustmail.com>
    Re: Earthquake and tornado data evaluation Perl program <dformosa@zeta.org.au>
    Re: Earthquake and tornado data evaluation Perl program <dformosa@zeta.org.au>
    Re: Finding all open filehandles and closing them befor (Bryan Castillo)
    Re: free source search engine (simple) ## comments? <gnari@simnet.is>
    Re: free source search engine (simple) ## comments? <webmaster @ infusedlight . net>
    Re: free source search engine (simple) ## comments? <webmaster @ infusedlight . net>
    Re: free source search engine (simple) ## comments? <webmaster @ infusedlight . net>
    Re: free source search engine (simple) ## comments? <webmaster @ infusedlight . net>
    Re: generating time series graphs with perl <jgibson@mail.arc.nasa.gov>
        How to define a sub on the fly? <socyl@987jk.com>
    Re: How to define a sub on the fly? (Walter Roberson)
    Re: How to define a sub on the fly? <uri@stemsystems.com>
    Re: How to tell Perl not to convert @mydomain.com part  (Walter Roberson)
    Re: How to tell Perl not to convert @mydomain.com part  <jurgenex@hotmail.com>
    Re: How to tell Perl not to convert @mydomain.com part  <xxala_qumsiehxx@xxyahooxx.com>
        MSSQL 2000 Connect Success <***************>
    Re: OSs with Perl installed <jtc@shell.dimensional.com>
    Re: OSs with Perl installed <jtc@shell.dimensional.com>
    Re: OSs with Perl installed <flavell@ph.gla.ac.uk>
    Re: OSs with Perl installed <abigail@abigail.nl>
    Re: OSs with Perl installed (Walter Roberson)
    Re: Parsing Path Data into Tree Structure <tadmc@augustmail.com>
    Re: Performance implications of using the Switch module <skuo@mtwhitney.nsc.com>
        print $query->scrolling_list (Chris)
    Re: Script to kill defunct and zombie processes <matternc@comcast.net>
    Re: search.pl <sbryce@scottbryce.com>
    Re: System Command Results <tadmc@augustmail.com>
    Re: System Command Results <jurgenex@hotmail.com>
    Re: WHAT IS THE POINT OF FORMMAIL ? <matthew.garrish@sympatico.ca>
    Re: WHAT IS THE POINT OF FORMMAIL ? <webmaster @ infusedlight . net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 30 Apr 2004 12:46:47 -0500
From: Henry Williams <***************>
Subject: Books online????
Message-Id: <f64590houchivatqrgusbvpsqn29nk1r8f@4ax.com>

I have been researching Perl extensively for the last 3 weeks. Along
the way I have found several Internet sites that have all the O'Reilly
books on perl, online. The even have the copyright notice published
along with all the books and all the chapters. The copyright clearly
states:

"This CD-ROM is intended for use by one individual. As such, you may
make copies for your own personal use. However, you may not provide
copies to others, or make this reference library available to others
over a LAN or other network."

However it is readily available on the Internet everywhere you care to
hunt. I have resisted mass downloading these sites but do wonder, have
any of you all noticed the same?

I buy all my books but wonder what's up with all this? I am not
posting URL's but that is a scarce barrier, as they are everywhere.

I will add that if not for O'Reilly my IQ would be reduced by 15%. So
to that extent I appreciate them a good deal. They have held me in
good stead for years.

What's up with all that? Heck you can get the real book from eBay for
pennies on the dollar. And I'd rather fall asleep with a good book, in
lieu of more favorable circumstances.

HW



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

Date: Fri, 30 Apr 2004 23:20:05 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: CGI.pm Escaping query strings - ampersand issue
Message-Id: <c6umse$9so$1@news.simnet.is>

"Matthew Salerno" <msalerno_rmhere_@bellsouth.net> wrote in message
news:2Kykc.98000$UC4.69547@bignews2.bellsouth.net...
>
[ query string ]
>
> The problem is that some of the directories contain ampersands "&".
>
> If there is an ampersand in the directory name, the the rest of the query
> string gets all messed up.
>
> ...
> $_ =~ s/\&/%26/g;
> Gives me:
> Software error:
> /TestDocs/70822/Paperwork_%26_Cover No Documents in this system No such
file
> or directory at /docs/index.cgi line 345.

you are using CGI.pm are you not?

by the way, you should properly urlencode your querystring parameters,
as there are more characters that may appear in filenames but are
not valid in querystrings.

gnari






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

Date: Fri, 30 Apr 2004 16:56:30 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: comparing decimal numbers
Message-Id: <slrnc95ise.5o4.tadmc@magna.augustmail.com>

Thens <thens@NOSPAMti.com> wrote:

> I have to compare two decimals numbers 1.5.0 and 2.1.1.


Those are not decimal numbers...


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 01 May 2004 08:45:10 +1000
From: ? the Platypus {aka David Formosa} <dformosa@zeta.org.au>
Subject: Re: Earthquake and tornado data evaluation Perl program  Apr. 14, 2004
Message-Id: <m3r7u52ih5.fsf@dformosa.zeta.org.au>

"edgrsprj" <edgrsprj@ix.netcom.com> writes:

[...]

> There is a Basic language version being prepared.  I have seen the
> preliminary code.  And it is probably a little more like the type of program
> you are used to seeing.

Not to sound like I'm a language bigot but why basic?  I suspect that
basic would be more unstructured then a perl version.  If you can put
in the effort to port the code to basic, why not put the effort into
porting the code to structured perl, C or even Psydocode if you wish
to make it easy to port into other languages.

-- 
Please excuse my spelling as I suffer from agraphia. See
http://dformosa.zeta.org.au/~dformosa/Spelling.html to find out more.
Free the Memes.


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

Date: 01 May 2004 08:48:22 +1000
From: ? the Platypus {aka David Formosa} <dformosa@zeta.org.au>
Subject: Re: Earthquake and tornado data evaluation Perl program  Apr. 14, 2004
Message-Id: <m3n04t2ibt.fsf@dformosa.zeta.org.au>

"edgrsprj" <edgrsprj@ix.netcom.com> writes:

> "A. Sinan Unur" <1usa@llenroc.ude> wrote in message
> news:Xns94CBCB008812asu1cornelledu@132.236.56.8...
> > "edgrsprj" <edgrsprj@ix.netcom.com> wrote in
> > news:YZcfc.7030$zj3.3864@newsread3.news.atl.earthlink.net:
> >
> > Well, your program managed to make me cry. Just two samples:
> 
> And it should make you cry, but for a reason which I suspect you are not
> considering.
> 
> There are quite a few countries around the world where cities and even
> entire governments could be decimated by an earthquake in just a few minutes
> time.  And to some extent that includes the United States.

Which is all the more reson why you should write your code in
structured easy to read form of perl (or whever else you wish to write
in).  Good structure and good programing pracitices are easyer to
debug and modify, if lives are depending on this code working
correctly then the only responcible thing to do is code it in a
structured mannor.

-- 
Please excuse my spelling as I suffer from agraphia. See
http://dformosa.zeta.org.au/~dformosa/Spelling.html to find out more.
Free the Memes.


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

Date: 30 Apr 2004 17:37:14 -0700
From: rook_5150@yahoo.com (Bryan Castillo)
Subject: Re: Finding all open filehandles and closing them before exiting
Message-Id: <1bff1830.0404301637.72245f49@posting.google.com>

Vilmos Soti <vilmos@vilmos.org> wrote in message news:<87k6zxv1iq.fsf@localhost.localdomain>...
> rook_5150@yahoo.com (Bryan Castillo) writes:
> 
> >> I have a signal handler which tries to unmount the disk in
> >> the case of a sigint, but it will fail if copy from File::Copy
> >> has an open filehandle on the mounted disk.
> 
> ...
> 
> > Try this: (worked on my system Fedora Core 1)
> 
> ...
> 
> > eval {
> >   copy ("/tmp/mountpoint/devzero", "/tmp/mountpoint/devnull");
> > };
> 
> Thanks for the idea, but it didn't work for me. Our system

What didn't work?  The device was still busy?  Or there was something
wrong with the script?  Do you have the output?

> is RedHat 7.3 with perl 5.6.0. I know this is a bit old,
> but for some reasons (which has nothing to do with technical
> or internal bureaucratic issues) it is not so easy to upgrade.
> 
> Vilmos


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

Date: Fri, 30 Apr 2004 23:05:48 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: free source search engine (simple) ## comments?
Message-Id: <c6um1l$9qj$1@news.simnet.is>

"Robin" <webmaster @ infusedlight . net> wrote in message
news:c6ucl0$c79$2@reader2.nmix.net...

robin, robin, robin.

here you go again.

your biggers problem is that you do not really listen
to the advice you are given.
if you do not understand what we are trying to tell you,
it is much better to ask for clarification than make the
exact sames mistakes in your next post.

for example, you  were told by a friendly soul in a recent post
why your search() will fail for other directories than './',
but this version still has the same problems.

you were also told by a more mischievous soul not to distribute
cgi scripts publicly because they are full of security holes,
and easily abused. this script , for example, can be used to hack
your site (again).

you do have a certain degree of tenacity, and your code is improving
a bit, but the regulars here would be more positive towards you
if you just showed some sign that you are trying to listen and learn.

gnari






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

Date: Fri, 30 Apr 2004 16:56:29 -0800
From: "Robin" <webmaster @ infusedlight . net>
Subject: Re: free source search engine (simple) ## comments?
Message-Id: <c6usr5$lje$2@reader2.nmix.net>


"Ala Qumsieh" <xxala_qumsiehxx@xxyahooxx.com> wrote in message
news:0xzkc.43241$OO2.34404@newssvr29.news.prodigy.com...
> "Robin" <webmaster @ infusedlight . net> wrote in message
> news:c6ucl0$c79$2@reader2.nmix.net...
>
> > btw, unless I change newsreaders which I haven't had much success with,
> I've
> > downloaded like 5 and none seem to work for me cause they don't work
with
> my
> > mail server my indenting is gonna be screwed up, so please bear with me.
>
> Two suggestions:
>
> 1. Download Mozilla from www.mozilla.org.
>
> 2. Please, please, please do not post your code for review on the
newsgroup.
> You can post asking for other people to review your code, but provide a
link
> of where they can download your code instead. I don't see any benefit of
> posting your code as it is generally easier for other people to download
it
> by clicking a button than by copy/pasting it from their newsreader.

Ok, sounds good. Next time I will post the link.

-Robin




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

Date: Fri, 30 Apr 2004 16:56:53 -0800
From: "Robin" <webmaster @ infusedlight . net>
Subject: Re: free source search engine (simple) ## comments?
Message-Id: <c6usr6$lje$3@reader2.nmix.net>


"Sherm Pendley" <spamtrap@dot-app.org> wrote in message
news:QfGdnUbstohTIA_dRVn-tw@adelphia.com...
> Robin wrote:
>
> > btw, unless I change newsreaders which I haven't had much success with,
> > I've downloaded like 5 and none seem to work for me cause they don't
work
> > with my mail server my indenting is gonna be screwed up, so please bear
> > with me.
>
> You mentioned earlier about spaces and tabs getting screwed up. I've seen
> that happen many times - the problem is that everyone has their own idea
> where the "right" place to put tab stops is. Some folks put them at every
4
> columns, some every 8, some every 2, etc. If you use tabs in your file,
and
> someone with different tab settings views the file, the formatting gets
> totally hosed.
>
> The solution is to avoid using tabs. I'm *not* saying don't indent your
> code! :-) I'm just saying to use spaces to do it, instead of tabs. Most
> programmer's editors have an option to insert spaces when you hit the tab
> key, so you'll hardly notice a difference when typing.

spaces eh? That's a good call:
-Robin




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

Date: Fri, 30 Apr 2004 16:57:48 -0800
From: "Robin" <webmaster @ infusedlight . net>
Subject: Re: free source search engine (simple) ## comments?
Message-Id: <c6usr6$lje$4@reader2.nmix.net>


"Richard Morse" <remorse@partners.org> wrote in message
news:remorse-9B1CF1.17071930042004@plato.harvard.edu...
> In article <c6ucl0$c79$2@reader2.nmix.net>,
>  "Robin" <webmaster @ infusedlight . net> wrote:
>
> > btw, unless I change newsreaders which I haven't had much success with,
I've
> > downloaded like 5 and none seem to work for me cause they don't work
with my
> > mail server my indenting is gonna be screwed up, so please bear with me.
>
> One possibility: run the following on your script file before you paste
> it into the message:
>
>    perl -i.orig -p -e "s/\t/    /g" my_perl_script
>
> where my_perl_script is the file with the code you want to paste.
> That's four space characters in the replacement string, although you can
> change that if you wish.
>

Thanks, I that's a very nifty example of code there.
-Robin





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

Date: Fri, 30 Apr 2004 16:34:25 -0800
From: "Robin" <webmaster @ infusedlight . net>
Subject: Re: free source search engine (simple) ## comments?
Message-Id: <c6usr4$lje$1@reader2.nmix.net>

>
> your biggers problem is that you do not really listen
> to the advice you are given.
> if you do not understand what we are trying to tell you,
> it is much better to ask for clarification than make the
> exact sames mistakes in your next post.
>
> for example, you  were told by a friendly soul in a recent post
> why your search() will fail for other directories than './',
> but this version still has the same problems.

ok, I finally figured out why it's not getting the other directories...

> you were also told by a more mischievous soul not to distribute
> cgi scripts publicly because they are full of security holes,
> and easily abused. this script , for example, can be used to hack
> your site (again).

how can this one be used to hack my site? I'm curious...

> you do have a certain degree of tenacity, and your code is improving
> a bit, but the regulars here would be more positive towards you
> if you just showed some sign that you are trying to listen and learn.
>
> gnari






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

Date: Fri, 30 Apr 2004 15:32:34 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: generating time series graphs with perl
Message-Id: <300420041532341649%jgibson@mail.arc.nasa.gov>

In article <pan.2004.04.29.21.46.50.587897@sneakemail.com>, Po Boy
<a5ufv8u02@sneakemail.com> wrote:

> I'm trying to find a perl module that will help me make a certain kind of
> graph. I believe it's called a time-series graph, but I'm not sure. It's a
> graph of how two variables behave over time. You can see a couple examples
> at:

As other posters have pointed out, the graph you want is not a
time-series graph. A time-series graph is plotting a single variable
against time. What you want (as also pointed out by others) is a
scatter-plot: plotting two variables against each other. You also want
to connect the points with lines in the order drawn. 

gnuplot can do this easily. Write the data to a file with one X,Y pair
per line in time order and tell gnuplot to plot the file 'with lines'.
If you also want symbols at the point, use 'with linespoints' instead.

If you want to have different colored points in your graph, you will
have to perform a second plot of those points using the 'with points'
style. Use one plot command and separate the different plots with a
comma. You can put the second plot data in the same file, separated by
two blank lines, and use the index option to select the various plot
data sets. Plot the lines first so the colored points show on top.

You won't get any arrowheads on the lines, however.

[rest snipped]


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

Date: Fri, 30 Apr 2004 22:08:50 +0000 (UTC)
From: kj <socyl@987jk.com>
Subject: How to define a sub on the fly?
Message-Id: <c6uipi$inb$1@reader2.panix.com>




Can someone please show me how to define a sub Foo::Bar::baz on
the fly (i.e. when the module is loaded)?

Thanks!

kj

-- 
NOTE: In my address everything before the period is backwards.


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

Date: 30 Apr 2004 22:22:00 GMT
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Subject: Re: How to define a sub on the fly?
Message-Id: <c6uji8$n1e$1@canopus.cc.umanitoba.ca>

In article <c6uipi$inb$1@reader2.panix.com>, kj  <socyl@987jk.com> wrote:
:Can someone please show me how to define a sub Foo::Bar::baz on
:the fly (i.e. when the module is loaded)?

Try constructing it inside a BEGIN block. BEGIN blocks are executed
as the module is loaded.
-- 
Disobey all self-referential sentences!


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

Date: Sat, 01 May 2004 00:11:12 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: How to define a sub on the fly?
Message-Id: <x73c6l3t27.fsf@mail.sysarch.com>

>>>>> "WR" == Walter Roberson <roberson@ibd.nrc-cnrc.gc.ca> writes:

  WR> In article <c6uipi$inb$1@reader2.panix.com>, kj  <socyl@987jk.com> wrote:
  WR> :Can someone please show me how to define a sub Foo::Bar::baz on
  WR> :the fly (i.e. when the module is loaded)?

  WR> Try constructing it inside a BEGIN block. BEGIN blocks are executed
  WR> as the module is loaded.

that won't help much. the module itself is executed at compile time when
it is loaded by the use statement so the BEGIN block gains little there.

but i would ask the OP what they mean by creating a sub on the fly and
why does he think it is needed? it isn't hard to do but i won't help if
it is not even needed.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: 30 Apr 2004 22:15:47 GMT
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Subject: Re: How to tell Perl not to convert @mydomain.com part  inside a body of message?
Message-Id: <c6uj6j$mjf$1@canopus.cc.umanitoba.ca>

In article <nbSdnd1CVrYwXA_dRVn-jw@adelphia.com>,
Sherm Pendley  <spamtrap@dot-app.org> wrote:
|Walter Roberson wrote:

|> In article <BomdnStHruSOKQ_d4p2dnA@adelphia.com>,
|> Sherm Pendley  <spamtrap@dot-app.org> wrote:

|> :As a shot in the dark though, I'd guess that the email message is in a
|> :double-quoted string, so Perl is trying to interpolate the array
|> :@myDomain into that string.

|> But it wouldn't try to do that unless you somehow try to execute
|> the string.

|Not true. Try this simple example:

Ah, I just reviewed the original posting, and see that it was ambiguous.
The original poster did not say that the perl script was sending email,
and I read the posting as indicating that the poster has a script that
is filtering email (somehow), due to the phrasing about the
"received email".

Yes, you are right that if the mail being sent is in a double-quoted
string then perl would try to interpolate @myDomain . But if this
is a case of a mail filter, then what I wrote holds. Having re-read the
original message, I now think your interpretation of the situation
is the more likely.
-- 
Inevitably, someone will flame me about this .signature.


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

Date: Sat, 01 May 2004 00:18:20 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: How to tell Perl not to convert @mydomain.com part  inside a body of message?
Message-Id: <g1Ckc.11258$sK3.4773@nwrddc03.gnilink.net>

Robin wrote:
> Sam, it's be nice to see your code, however I had that exact same
> issue with one of my scripts... instead of using something like print
> MAIL "myuser@mydomain.com";  use print MAIL "myuser\@mydomain.com";
> that way it won't try to interperate the array @mydomain -
> Hope this helps.

While this avoids the symptom it doesn't cure the desease.
Just use single quotes instead of double quotes if you want variables _not_
to be interpolated.

jue




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

Date: Sat, 01 May 2004 00:31:10 GMT
From: "Ala Qumsieh" <xxala_qumsiehxx@xxyahooxx.com>
Subject: Re: How to tell Perl not to convert @mydomain.com part  inside a body of message?
Message-Id: <idCkc.43281$Yf4.30994@newssvr29.news.prodigy.com>

"Jürgen Exner" <jurgenex@hotmail.com> wrote in message
news:g1Ckc.11258$sK3.4773@nwrddc03.gnilink.net...
> Robin wrote:
> > Sam, it's be nice to see your code, however I had that exact same
> > issue with one of my scripts... instead of using something like print
> > MAIL "myuser@mydomain.com";  use print MAIL "myuser\@mydomain.com";
> > that way it won't try to interperate the array @mydomain -
> > Hope this helps.
>
> While this avoids the symptom it doesn't cure the desease.
> Just use single quotes instead of double quotes if you want variables
_not_
> to be interpolated.

Backwacking a literal @ in a double-quoted string *IS* a cure for the
problem. I tend to use single quotes whenever I can, but if I ever needed a
literal @ in a string where I also need to interpolate other variables, I
will not hesitate to backslash it. There is nothing wrong with that.
Afterall, TMTOWTDI.

--Ala




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

Date: Fri, 30 Apr 2004 11:47:53 -0500
From: Henry Williams <***************>
Subject: MSSQL 2000 Connect Success
Message-Id: <rlv490d2q60bfpm21ci9lr1dm5p2eqbmgj@4ax.com>




OK, I'm a newbie to perl, at any rate I wanted this post to exist for
posterity given that I searched a good bit before finding what I
needed. (I included in my subject the type of strings I wished hunted
for.) 
All the heck I wanted to do was to connect via a DSN to a darn MSSQL
server, and get some data. I would have thought that was sort of
germane given the pervasiveness of Microsoft in the land. With Active
Perl being free, and with the availability of Tk, I rather expect Perl
to take over the known world, except for maybe Bali or Taos.

So as a Perl virgin (watch it boys..) I hereby do thus submit this
code pregnant with the need for improvement to any such as myself who
choose the same search string I did when lurking this NG.

<CROWN><BOSE><AC/DC::Highway to Hell></BOSE></CROWN>

"So you want to use a DSN and get at that M$ data  well baby, let me
introduce on Stage #1, it's Vanessa, give her a big hand!!  You'll
notice tattooed across her <snip> a little snippet for all you
Micro$oft guys out there, lean in close now, here we go.."



#!perl
 use warnings;
 use Win32::ODBC;

    $db = new Win32::ODBC( "MyDSN" ) || die "Error: " .
    Win32::ODBC::Error();
    if( ! $db->Sql( "SELECT * FROM tHe_NamE_Of_your_tAbLe" ) )
    {
        while( $db->FetchRow() )
        {
            my( @list ) = $db->Data();
            print "@list";
            print "\n" ;
        }
    }
    $db->Close();


Until later then,

Henry




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

Date: 30 Apr 2004 16:22:51 -0600
From: Jim Cochrane <jtc@shell.dimensional.com>
Subject: Re: OSs with Perl installed
Message-Id: <slrnc95kdr.38s.jtc@shell.dimensional.com>

In article <slrnc954r7.egl.abigail@alexandra.abigail.nl>, Abigail wrote:
> Jim Cochrane (jtc@shell.dimensional.com) wrote on MMMDCCCXCIII September
> MCMXCIII in <URL:news:slrnc90c86.jn1.jtc@shell.dimensional.com>:
>:}  
>:}  Unfortunately, since MS does not include Perl as a standard component,
>:}  it's also true that most computers these days do not have Perl installed.
>:}  (I can only think of advantages to MS including Perl with their OS -
>:}  can't think of any disadvantages, so I'm can't understand why they don't
>:}  do it.  Am I missing something?)
> 
> 
> I think that's bloody obvious. If you sell something, you are supposed
> to support it as well. Perl development is something that isn't under
> Microsoft's control. Considering the platforms Microsoft is mostly
> targeting (the desktop, servers with prepacked solutions), I can't
> understand why anyone doesn't understand Microsoft doesn't include Perl
> in its OS.

You have a point.  On the other hand, other commercial OSs (such as, I
believe, Mac OS X and Solaris 9) come with several well established
free software packages, including several GNU utilities and Perl.
Companies like Sun and Apple also don't have control over Perl, so why do
they include it?  Sure, MS is focused on the desktop and GUI-based servers,
but it seems that they would compete better with UNIX systems if they
would realize that such utilities are taken for granted by many developers,
as well as being a reasonable choice for implementation of many server and
some desktop applications.  And .Net is designed to be used with a large
range of languages (including Perl, I believe).  Wouldn't it be more
appealing to those considering using it if more of these languages were
available (if not officially supported, at least included as "extras")?


-- 
Jim Cochrane; jtc@dimensional.com
[When responding by email, include the term non-spam in the subject line to
get through my spam filter.]


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

Date: 30 Apr 2004 16:26:10 -0600
From: Jim Cochrane <jtc@shell.dimensional.com>
Subject: Re: OSs with Perl installed
Message-Id: <slrnc95kk2.38s.jtc@shell.dimensional.com>

In article <87wu3zjx6u.fsf@mithril.chromatico.net>, Charlton Wilbur wrote:
>>>>>> "JC" == Jim Cochrane <jtc@shell.dimensional.com> writes:
> 
>    JC> Unfortunately, since MS does not include Perl as a standard
>    JC> component, it's also true that most computers these days do
>    JC> not have Perl installed.  (I can only think of advantages to
>    JC> MS including Perl with their OS - can't think of any
>    JC> disadvantages, so I'm can't understand why they don't do it.
>    JC> Am I missing something?)
> 
> If Microsoft included Perl, they couldn't charge people for Visual
> Basic, and people who mastered Perl on the Microsoft platform could
> easily pack up and move to another platform without a lot of trouble. 
> 
> So they can't charge for it, it cuts into sales of one of their
> products, and it doesn't lock people into their platform.

Yes, that sounds like the typical provincial MS outlook.  On the other hand,
from that point of view, aren't they shooting themselves in the foot by
providing a platform, .net., that is language agnostic? :-)

-- 
Jim Cochrane; jtc@dimensional.com
[When responding by email, include the term non-spam in the subject line to
get through my spam filter.]


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

Date: Fri, 30 Apr 2004 23:41:30 +0100
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: OSs with Perl installed
Message-Id: <Pine.LNX.4.53.0404302338140.29743@ppepc56.ph.gla.ac.uk>

On Fri, 30 Apr 2004, Jim Cochrane wrote:

> You have a point.  On the other hand, other commercial OSs (such as, I
> believe, Mac OS X and Solaris 9) come with several well established
> free software packages, including several GNU utilities and Perl.

Neither of those vendors seem to be under any illusion about their
ability to take over the universe.  Hence or otherwise deduce...


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

Date: 30 Apr 2004 23:51:30 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: OSs with Perl installed
Message-Id: <slrnc95pk2.egl.abigail@alexandra.abigail.nl>

Jim Cochrane (jtc@shell.dimensional.com) wrote on MMMDCCCXCV September
MCMXCIII in <URL:news:slrnc95kdr.38s.jtc@shell.dimensional.com>:
!!  In article <slrnc954r7.egl.abigail@alexandra.abigail.nl>, Abigail wrote:
!! > Jim Cochrane (jtc@shell.dimensional.com) wrote on MMMDCCCXCIII September
!! > MCMXCIII in <URL:news:slrnc90c86.jn1.jtc@shell.dimensional.com>:
!! >:}  
!! >:}  Unfortunately, since MS does not include Perl as a standard component,
!! >:}  it's also true that most computers these days do not have Perl installed.
!! >:}  (I can only think of advantages to MS including Perl with their OS -
!! >:}  can't think of any disadvantages, so I'm can't understand why they don't
!! >:}  do it.  Am I missing something?)
!! > 
!! > 
!! > I think that's bloody obvious. If you sell something, you are supposed
!! > to support it as well. Perl development is something that isn't under
!! > Microsoft's control. Considering the platforms Microsoft is mostly
!! > targeting (the desktop, servers with prepacked solutions), I can't
!! > understand why anyone doesn't understand Microsoft doesn't include Perl
!! > in its OS.
!!  
!!  You have a point.  On the other hand, other commercial OSs (such as, I
!!  believe, Mac OS X and Solaris 9) come with several well established
!!  free software packages, including several GNU utilities and Perl.
!!  Companies like Sun and Apple also don't have control over Perl, so why do
!!  they include it?  Sure, MS is focused on the desktop and GUI-based servers,
!!  but it seems that they would compete better with UNIX systems if they
!!  would realize that such utilities are taken for granted by many developers,
!!  as well as being a reasonable choice for implementation of many server and
!!  some desktop applications.  And .Net is designed to be used with a large
!!  range of languages (including Perl, I believe).  Wouldn't it be more
!!  appealing to those considering using it if more of these languages were
!!  available (if not officially supported, at least included as "extras")?


Take the set of people using Windows. Pick 100 random people from it.
Ask them whether they miss having Perl under Windows.

Take the set of people using a different OS than Windows. Pick 100
random people from it. Ask them whether they would have used Windows
instead if Windows had included Perl.

Of the two hundred questions asked - how many "Yes" answers do you expect
to get? Right. So does Microsoft.


Abigail
-- 
sub A::TIESCALAR{bless\my$x=>A};package B;@q[0..3]=qw/Hacker Perl
Another Just/;use overload'""'=>sub{pop @q};sub A::FETCH{bless\my
$y=>B}; tie my $shoe => qq 'A';print "$shoe $shoe $shoe $shoe\n";


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

Date: 1 May 2004 00:12:42 GMT
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Subject: Re: OSs with Perl installed
Message-Id: <c6uq1q$2h7$1@canopus.cc.umanitoba.ca>

In article <slrnc95pk2.egl.abigail@alexandra.abigail.nl>,
Abigail  <abigail@abigail.nl> wrote:
:Take the set of people using Windows. Pick 100 random people from it.
:Ask them whether they miss having Perl under Windows.

:Take the set of people using a different OS than Windows. Pick 100
:random people from it. Ask them whether they would have used Windows
:instead if Windows had included Perl.

:Of the two hundred questions asked - how many "Yes" answers do you expect
:to get? Right. So does Microsoft.

Depends what you mean by "used Windows". I'm a unix sort of guy who
does some code development. I'd be very unlikely to switch to Windows
as my primary desktop -- but my perl code could be used pretty much
unchanged on Windows, then I'd be a lot more likely to do a Windows port
for the sake of my users (who aren't generally unix sort of people.)

[What I gather from sampling postings here, is that adapting 
unix-developed perl code for Windows is still a bother, rather than
just a matter of a few tweaks.]
-- 
100% of all human deaths occur within 100 miles of Earth.


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

Date: Fri, 30 Apr 2004 17:03:02 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Parsing Path Data into Tree Structure
Message-Id: <slrnc95j8m.5o4.tadmc@magna.augustmail.com>

David K. Wall <dwall@fastmail.fm> wrote:
> Dale <desau@aisc.ac.cy> wrote:
> 
>> What I am trying
>> to do is take a very plain text string describing a path and parse
>> that into a tree to display in html.


> Search Google groups for Message-ID 
><slrnbhtb7u.4o7.tadmc@magna.augustmail.com> and you'll find an 
> algorithm you can adapt.


Or adapt this shell one-liner (good luck!).   :-)


   find . -print | sed -e 's,[^/]*/\([^/]*\)$,`--\1,' -e 's,[^/]*/,|  ,g'


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Fri, 30 Apr 2004 13:58:18 -0700
From: Steven Kuo <skuo@mtwhitney.nsc.com>
Subject: Re: Performance implications of using the Switch module
Message-Id: <Pine.GSO.4.21.0404301354220.23840-100000@mtwhitney.nsc.com>

On 30 Apr 2004, GreenLight wrote:

> I hate looking at rows and rows of elsif statements as much as the
> next person, but using the Switch module just doesn't cut it. I wrote:

(snipped) ...

> 		if ($tag eq 'TAG001') { push @parsed, $value }
> 		elsif ($tag eq 'TAG002') { push @parsed, $value }
> 		elsif ($tag eq 'TAG003') { push @parsed, $value }
> 		elsif ($tag eq 'TAG004') { push @parsed, $value }
> 		elsif ($tag eq 'TAG005') { push @parsed, $value }
> 		elsif ($tag eq 'TAG006') { push @parsed, $value }
> 		elsif ($tag eq 'TAG007') { push @parsed, $value }
> 		elsif ($tag eq 'TAG008') { push @parsed, $value }
> 		elsif ($tag eq 'TAG009') { push @parsed, $value }
> 		elsif ($tag eq 'TAG010') { push @parsed, $value }
> 		else { die "Bad tag!" }


(snipped) ...

> 		switch ($tag) {
> 			case "TAG001" { push @parsed, $value }
> 			case "TAG002" { push @parsed, $value }
> 			case "TAG003" { push @parsed, $value }
> 			case "TAG004" { push @parsed, $value }
> 			case "TAG005" { push @parsed, $value }
> 			case "TAG006" { push @parsed, $value }
> 			case "TAG007" { push @parsed, $value }
> 			case "TAG008" { push @parsed, $value }
> 			case "TAG009" { push @parsed, $value }
> 			case "TAG010" { push @parsed, $value }
> 			else { die "Bad tag!" }
> 		}

 ...
> timethese (100000, {
> 		"Using 'if'" => \&use_if,
> 		"Using 'switch'" => \&use_switch
> 	});
> 
> __END__
> 
> These subroutines adequately represent tasks performed thousands of
> times per day at my client's site.
> And the results:
> 
> Benchmark: timing 100000 iterations of Using 'if', Using 'switch'...
> Using 'if': 17 wallclock secs (16.48 usr +  0.00 sys = 16.48 CPU) @
> 6066.49/s (n=100000)
> Using 'switch': 153 wallclock secs (150.68 usr +  0.00 sys = 150.68
> CPU) @ 663.68/s (n=100000)
> 
> Using "switch" was nearly an order of magnitude slower.



I'd suggest that you use a hash instead.  To me it's easier to read
and maintain:

{
    # closure defined in this scope

    my %good = map +('TAG' . sprintf("%03d", $_) => 1 ), ( 1 .. 10 );

    sub use_hash {
	    my @parsed;
	    my @tags = (
		"TAG001^VALUE001", 
		"TAG002^VALUE002", 
		"TAG003^VALUE003",
                "TAG004^VALUE004", 
		"TAG005^VALUE005",
		"TAG006^VALUE006", 
		"TAG007^VALUE007", 
		"TAG008^VALUE008",
		"TAG009^VALUE009",
		"TAG010^VALUE010",
	    );
	    foreach my $next (@tags) {
		    my ($tag, $value) = ($next =~ /^(.*?)\^(.*?)$/);
		    if ($good{$tag}) {
			push @parsed, $value;
			print "DEBUG: pushed $value into array \@parsed\n";
		    } else { 
			die "Bad tag ($tag)!";
		    }
	    }
    }
}

use_hash();

I did not benchmark but it may be faster than what you've already
tried.

-- 
Hope this helps,
Steven



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

Date: 30 Apr 2004 18:04:10 -0700
From: chris_12003@yahoo.com (Chris)
Subject: print $query->scrolling_list
Message-Id: <7f746dd.0404301704.7aed779c@posting.google.com>

I have the following code and am trying to have different values than
what the user clicks on.

print $query->scrolling_list (
     -name=>'forsale',
     -value=>['No','Yes'],
     -size=>2
     -multiple=>'false');

Right now when I view my source in the browser it shows as
<SELECT NAME="forsale" SIZE=2 FALSE>
<OPTION  VALUE="No">No
<OPTION  VALUE="Yes">Yes
</SELECT>

and I need it to be (values below are different)
<SELECT NAME="forsale" SIZE=2 FALSE>
<OPTION  VALUE="">No
<OPTION  VALUE="s">Yes
</SELECT>

How would I change the print $query-> to allow this.

Thanks,
Chris


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

Date: Fri, 30 Apr 2004 20:14:43 -0400
From: Chris Mattern <matternc@comcast.net>
Subject: Re: Script to kill defunct and zombie processes
Message-Id: <D7SdnWCaYflodg_d4p2dnA@comcast.com>

Bryan Castillo wrote:

> srini@rocketmail.com (Srini Vuggumudi) wrote in message
> news:<ac3f7819.0404291152.7256df16@posting.google.com>...
>> Hello Friends,
>> 
>> While browsing the messages in this new group, I found that a couple
>> of people tried and successful in cleaning the defunct and zombie
>> process using a PERL or shell script.
>> 
>> If you have a working script that cleans defuncts and zombies , could
>> you please post it? I appreciate your help. I do not have experience
>> with SIGNALS in PERL.
>> 
>> Also, here is my problem:
>> 
>> I have an apache/mysql/perl/Linux environment running cgis. My
>> webserver runs fine for a couple of days. After a month or so, it
>> starts running really slow (if someone try to access the URL, the
>> response will be slow). When the webserver responses are slow, If I do
>> ps -aef, I do see a lot of defunts. Aslo, if I do "top", I do see the
>> zombies count as 60 - 70. I believe these defunts and zombies may be
>> taking my webserver's resources and making it run slow.
>> 
>> Any suggesstions?
>> 
>> If you have a working script that cleans defuncts and zombies , could
>> you please post it? I appreciate your help.
>> 
> 
> This works, but I wouldn't suggest you use it  :~)
> 
> use strict;
> use warnings;
> use IO::File;
> my %bad_parents;
> 
> my $pipe = IO::File->new("ps -ef |") || die $!;
> while (my $line = <$pipe>) {
>   if ($line =~ /^\S+\s+(\d+)\s+(\d+)\s+.*<defunct>/) {
>     my ($pid, $ppid) = ($1,$2);
>     print "Found zombie: $pid\n";
>     $bad_parents{$ppid} = 1;
>   }
> }
> $pipe->close;
> 
> while (my ($ppid,$val) = each %bad_parents) {
>   print "Killing $ppid\n";
>   kill KILL=>$ppid;
> }
> 
> 
Rather like dealing with a hangnail by taking an axe to the finger.
Solves the problem under consideration, but not likely to improve 
the overall situation...
-- 
             Christopher Mattern

"Which one you figure tracked us?"
"The ugly one, sir."
"...Could you be more specific?"


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

Date: Fri, 30 Apr 2004 17:14:06 -0600
From: Scott Bryce <sbryce@scottbryce.com>
Subject: Re: search.pl
Message-Id: <1095ndnlvlquue9@corp.supernews.com>

Sherm Pendley wrote:

> The error checking isn't something to pretty up later in the process - it's
> there to help you find your bugs. This bug would have been obvious to you,
> if the error message had included the full file name and $!.

It is also easier to do the error checking as you write the code the 
first time than to try to wedge it in after the fact. First, the 
possibility of having to handle an error at any particular part of the 
code should be obvious as you write the code, and may not be later. 
Second, error handling may effect your logic.



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

Date: Fri, 30 Apr 2004 17:07:15 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: System Command Results
Message-Id: <slrnc95jgj.5o4.tadmc@magna.augustmail.com>

Gary <reachus@netlink.info> wrote:

> I can see how to check success or failure of a system command but how can I
> see what was actually returned by the command to be able to do further
> processing.


   print 'system returned: ', system('some command'), "\n";


> I know I could write the answer to a file and read the file but it seems
> pretty crude.


Huh?

Oh, you do NOT want what was returned from system().

You appear to want the OUTPUT generated from system().

The docs for system() tell how to do that.

   perldoc -f system

   ... This is not what you want to use to capture the output from 
   a command, for that you should use merely ...


Please don't ask thousands of people to read the docs for you!


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Sat, 01 May 2004 00:23:31 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: System Command Results
Message-Id: <76Ckc.11270$sK3.7192@nwrddc03.gnilink.net>

Gary wrote:
> I can see how to check success or failure of a system command but how
> can I see what was actually returned by the command to be able to do
> further processing.
>
> I know I could write the answer to a file and read the file but it
> seems pretty crude.

Which part of the third paragraph of the man page for system() do you not
understand?

perldoc -f system:

            [...] This is
           *not* what you want to use to capture the output from a command,
           for that you should use merely backticks or "qx//", as described
           in the section on "`STRING`" in the perlop manpage. [...]

jue




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

Date: Fri, 30 Apr 2004 19:35:46 -0400
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: WHAT IS THE POINT OF FORMMAIL ?
Message-Id: <ipBkc.53889$OU.1198325@news20.bellglobal.com>


"Robin" <webmaster @ infusedlight . net> wrote in message
news:c6u4gn$677$1@reader2.nmix.net...
>
> "Nomen Nescio" <nobody@dizum.com> wrote in message
> news:fc48601f9736c2fbd4ac804219d29e33@dizum.com...
> > WHY ? No one needs this outdated crap anymore.
> >
> > 3 lines of PHP can do what shitty formmail does and better and more
> safely.
> >
> > Formmail is the spammers choice, formmail is so controversial that many
> hosts
> > ban it outright.
> >
> > Clunky, outdated shit and if you have an old version it is full of holes
> and
> > exploits for hackers and spammers.
> >
> > Fuck of formmail you suck. Totally pointless useless shit. go away
> formmail
>
> I should plug you into a formmail script and see what kinda spam I can
send.
> jk, but seriously, can't you post to a  php group?
>

Hell, why don't you just hook him up with one of your formmail-esque
scripts.

Oh yeah, you can't even write formmail quality scripts yet...

Matt




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

Date: Fri, 30 Apr 2004 16:59:54 -0800
From: "Robin" <webmaster @ infusedlight . net>
Subject: Re: WHAT IS THE POINT OF FORMMAIL ?
Message-Id: <c6usr7$lje$5@reader2.nmix.net>


"Matt Garrish" <matthew.garrish@sympatico.ca> wrote in message
news:ipBkc.53889$OU.1198325@news20.bellglobal.com...
>
> "Robin" <webmaster @ infusedlight . net> wrote in message
> news:c6u4gn$677$1@reader2.nmix.net...
> >
> > "Nomen Nescio" <nobody@dizum.com> wrote in message
> > news:fc48601f9736c2fbd4ac804219d29e33@dizum.com...
> > > WHY ? No one needs this outdated crap anymore.
> > >
> > > 3 lines of PHP can do what shitty formmail does and better and more
> > safely.
> > >
> > > Formmail is the spammers choice, formmail is so controversial that
many
> > hosts
> > > ban it outright.
> > >
> > > Clunky, outdated shit and if you have an old version it is full of
holes
> > and
> > > exploits for hackers and spammers.
> > >
> > > Fuck of formmail you suck. Totally pointless useless shit. go away
> > formmail
> >
> > I should plug you into a formmail script and see what kinda spam I can
> send.
> > jk, but seriously, can't you post to a  php group?
> >
>
> Hell, why don't you just hook him up with one of your formmail-esque
> scripts.
>
> Oh yeah, you can't even write formmail quality scripts yet...
>
> Matt

I should heheh.... my formail is only 20 lines or so and is so fucking
insecure, I'm not even using it anymore.





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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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 V10 Issue 6496
***************************************


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