[30419] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1662 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 20 14:10:02 2008

Date: Fri, 20 Jun 2008 11:09:23 -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, 20 Jun 2008     Volume: 11 Number: 1662

Today's topics:
    Re: Does sleep increase server load? <tzz@lifelogs.com>
        Emulating system('COMMAND &')  on Windows without using <jacobcdf@yahoo.com>
    Re: Emulating system('COMMAND &')  on Windows without u <willem@stack.nl>
    Re: Emulating system('COMMAND &')  on Windows without u xhoster@gmail.com
    Re: Emulating system('COMMAND &')  on Windows without u <tzz@lifelogs.com>
    Re: Emulating system('COMMAND &') on Windows without us <jacobcdf@yahoo.com>
    Re: Emulating system('COMMAND &') on Windows without us <jacobcdf@yahoo.com>
    Re: Emulating system('COMMAND &') on Windows without us <jacobcdf@yahoo.com>
    Re: Emulating system('COMMAND &') on Windows without us <willem@stack.nl>
    Re: Emulating system('COMMAND &') on Windows without us <jacobcdf@yahoo.com>
    Re: Emulating system('COMMAND &') on Windows without us xhoster@gmail.com
    Re: Emulating system('COMMAND &') on Windows without us <willem@stack.nl>
    Re: Emulating system('COMMAND &') on Windows without us <jacobcdf@yahoo.com>
    Re: Emulating system('COMMAND &') on Windows without us <ben@morrow.me.uk>
    Re: FAQ 8.2 How come exec() doesn't return? <brian.d.foy@gmail.com>
    Re: FAQ 8.2 How come exec() doesn't return? xhoster@gmail.com
        Filtering a string <bill@ts1000.us>
    Re: Filtering a string <daveb@addr.invalid>
    Re: Filtering a string <ben@morrow.me.uk>
    Re: Learning Perl <uri@stemsystems.com>
    Re: Learning Perl <tzz@lifelogs.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 20 Jun 2008 11:14:51 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Does sleep increase server load?
Message-Id: <86fxr8t75w.fsf@lifelogs.com>

On Thu, 19 Jun 2008 13:48:14 -0700 (PDT) Jason Carlton <jwcarlton@gmail.com> wrote: 

JC> Ahh, good points, from both of you. I do prefer to create my own
JC> processes, mainly for the fun of it, so I might set up a catcha-type
JC> process, instead.

Ah, I hate those with a passion.

JC> I dread that, though, because some of my site visitors are (please
JC> forgive me) about as dumb as a box of hammers! LOL  For instance, I
JC> have a significant portion that don't bother to enter the part of
JC> their email address after the @; they just ASSUME that I would know
JC> who their provider is!

I don't know the purpose of your setup, but maybe you will have to use
mod_perl to process these forms quickly.  It's very efficient with
repeated requests; compared to regular Perl CGI I've experienced a 2-10x
speed improvement.  If you can stuff incoming data in a file and then
process it offline as a batch, your form handler just needs to check the
fields so it will be even faster.  Finally, you can use Javascript to
validate form fields before they hit the form handler (there are many
such libraries, some decent), which will not eliminate bad data but will
make it less frequent and thus your handler will run less frequently.

JC> People have taught me a whole new meaning to "keep it at a 3rd grade
JC> level" :-)

Yes, unfortunately reality is that most people don't have time or
interest in instructions, they just want to get through the form and go
home to watch TV...

Ted


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

Date: Fri, 20 Jun 2008 06:39:54 -0700 (PDT)
From: Jacob JKW <jacobcdf@yahoo.com>
Subject: Emulating system('COMMAND &')  on Windows without using fork()
Message-Id: <e86e0dab-b069-4681-8a30-0ac22dea8fac@i76g2000hsf.googlegroups.com>

I'm trying to emulate the UNIX behavior of system('COMMAND &')  on
Windows without having to use fork().

I'd like to avoid this because the overhead of copying all data by
value to the child process is rather substantial. Furthermore, were I
to use fork() I'd eventually having to deal with the unintended
consequences of methods called by the eventual object destruction in
the child process.

Thanks in advance.


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

Date: Fri, 20 Jun 2008 15:24:01 +0000 (UTC)
From: Willem <willem@stack.nl>
Subject: Re: Emulating system('COMMAND &')  on Windows without using fork()
Message-Id: <slrng5nish.187.willem@snail.stack.nl>

Jacob JKW wrote:
) I'm trying to emulate the UNIX behavior of system('COMMAND &')  on
) Windows without having to use fork().

Why not use the standard windows functionality?
IIRC, it was system('start COMMAND').


SaSW, Willem
-- 
Disclaimer: I am in no way responsible for any of the statements
            made in the above text. For all I know I might be
            drugged or something..
            No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT


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

Date: 20 Jun 2008 15:40:30 GMT
From: xhoster@gmail.com
Subject: Re: Emulating system('COMMAND &')  on Windows without using fork()
Message-Id: <20080620114031.959$SY@newsreader.com>

Jacob JKW <jacobcdf@yahoo.com> wrote:
> I'm trying to emulate the UNIX behavior of system('COMMAND &')  on
> Windows without having to use fork().

Have you tried:

system(1,'COMMAND')

I don't if it will work for your purposes, but it's the first thing I'd
try.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.


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

Date: Fri, 20 Jun 2008 11:18:52 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Emulating system('COMMAND &')  on Windows without using fork()
Message-Id: <86bq1wt6z7.fsf@lifelogs.com>

On Fri, 20 Jun 2008 06:39:54 -0700 (PDT) Jacob JKW <jacobcdf@yahoo.com> wrote: 

JJ> I'm trying to emulate the UNIX behavior of system('COMMAND &')  on
JJ> Windows without having to use fork().

JJ> I'd like to avoid this because the overhead of copying all data by
JJ> value to the child process is rather substantial. Furthermore, were I
JJ> to use fork() I'd eventually having to deal with the unintended
JJ> consequences of methods called by the eventual object destruction in
JJ> the child process.

To avoid fork penalties, you can fork early and communicate between
processes as needed.

Ted


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

Date: Fri, 20 Jun 2008 09:09:10 -0700 (PDT)
From: Jacob JKW <jacobcdf@yahoo.com>
Subject: Re: Emulating system('COMMAND &') on Windows without using fork()
Message-Id: <5e17899b-abc9-47cd-bde6-c7c3cea52c52@c58g2000hsc.googlegroups.com>

On Jun 20, 11:24=A0am, Willem <wil...@stack.nl> wrote:
> Jacob JKW wrote:
>
> ) I'm trying to emulate the UNIX behavior of system('COMMAND &') =A0on
> ) Windows without having to use fork().
>
> Why not use the standard windows functionality?
> IIRC, it was system('start COMMAND').
Because until now I was blissfully unaware of its existence.

It looks very promising. (Only problem is that it seems to pull up a
command window with each invocation.. Clearly not a Perl issue,
however.)

Thank you very much. Highly appreciated.



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

Date: Fri, 20 Jun 2008 09:13:08 -0700 (PDT)
From: Jacob JKW <jacobcdf@yahoo.com>
Subject: Re: Emulating system('COMMAND &') on Windows without using fork()
Message-Id: <710d4646-bc0b-461a-8f24-31b081389043@l64g2000hse.googlegroups.com>

On Jun 20, 11:40=A0am, xhos...@gmail.com wrote:
> Jacob JKW <jacob...@yahoo.com> wrote:
> > I'm trying to emulate the UNIX behavior of system('COMMAND &') =A0on
> > Windows without having to use fork().
>
> Have you tried:
>
> system(1,'COMMAND')
>
> I don't if it will work for your purposes, but it's the first thing I'd
> try.
No, I hadn't tried it, but very preliminary testing looks promising.
(I only fear that it may still be a fork() behind the scenes -- I'll
have it to test that further).

But anyway, where is this behavior documented? The perl doc on the
system command doesn't appear to it mention at all.

Many thanks and much appreciated.


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

Date: Fri, 20 Jun 2008 09:17:33 -0700 (PDT)
From: Jacob JKW <jacobcdf@yahoo.com>
Subject: Re: Emulating system('COMMAND &') on Windows without using fork()
Message-Id: <029da9ff-373f-4805-b20a-90dd4038c02b@34g2000hsf.googlegroups.com>

On Jun 20, 12:09=A0pm, Jacob JKW <jacob...@yahoo.com> wrote:
> On Jun 20, 11:24=A0am, Willem <wil...@stack.nl> wrote:> Jacob JKW wrote:
>
> > ) I'm trying to emulate the UNIX behavior of system('COMMAND &') =A0on
> > ) Windows without having to use fork().
>
> > Why not use the standard windows functionality?
> > IIRC, it was system('start COMMAND').
>
> It looks very promising. (Only problem is that it seems to pull up a
> command window with each invocation.. Clearly not a Perl issue,
> however.)
Even if clearly not a Perl issue it turns out that the way to avoid
the creation of a new window is with the /B switch so:

system('start /B COMMAND');


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

Date: Fri, 20 Jun 2008 16:17:52 +0000 (UTC)
From: Willem <willem@stack.nl>
Subject: Re: Emulating system('COMMAND &') on Windows without using fork()
Message-Id: <slrng5nm1g.3oa.willem@snail.stack.nl>

Jacob JKW wrote:
) No, I hadn't tried it, but very preliminary testing looks promising.
) (I only fear that it may still be a fork() behind the scenes -- I'll
) have it to test that further).
)
) But anyway, where is this behavior documented? The perl doc on the
) system command doesn't appear to it mention at all.

This basically has nothing to do with perl.

start is a windows CLI command.
I think you can type 'help start' in a dos box.
Or otherwise, websearch for it.

I think there are also options to suppress the popup dosbox,
although that may be in the perl Win32 package.


SaSW, Willem
-- 
Disclaimer: I am in no way responsible for any of the statements
            made in the above text. For all I know I might be
            drugged or something..
            No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT


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

Date: Fri, 20 Jun 2008 09:24:29 -0700 (PDT)
From: Jacob JKW <jacobcdf@yahoo.com>
Subject: Re: Emulating system('COMMAND &') on Windows without using fork()
Message-Id: <c26a299e-f250-4558-ae78-543fcd0168c5@m73g2000hsh.googlegroups.com>

On Jun 20, 12:17=A0pm, Willem <wil...@stack.nl> wrote:
> Jacob JKW wrote:
>
> ) No, I hadn't tried it, but very preliminary testing looks promising.
> ) (I only fear that it may still be a fork() behind the scenes -- I'll
> ) have it to test that further).
> )
> ) But anyway, where is this behavior documented? The perl doc on the
> ) system command doesn't appear to it mention at all.
>
> This basically has nothing to do with perl.
>
> start is a windows CLI command.
> I think you can type 'help start' in a dos box.
> Or otherwise, websearch for it.
>
> I think there are also options to suppress the popup dosbox,
> although that may be in the perl Win32 package.
The post to which you're replying was my reply to xhos post where he
had suggested system(1,COMMAND);

I was asking where *that* was documented.

Perhaps I need a better news client than Google. ;)


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

Date: 20 Jun 2008 16:39:06 GMT
From: xhoster@gmail.com
Subject: Re: Emulating system('COMMAND &') on Windows without using fork()
Message-Id: <20080620123908.074$vT@newsreader.com>

Jacob JKW <jacobcdf@yahoo.com> wrote:
> On Jun 20, 11:40=A0am, xhos...@gmail.com wrote:
> > Jacob JKW <jacob...@yahoo.com> wrote:
> > > I'm trying to emulate the UNIX behavior of system('COMMAND &') =A0on
> > > Windows without having to use fork().
> >
> > Have you tried:
> >
> > system(1,'COMMAND')
> >
> > I don't if it will work for your purposes, but it's the first thing I'd
> > try.

> No, I hadn't tried it, but very preliminary testing looks promising.
> (I only fear that it may still be a fork() behind the scenes -- I'll
> have it to test that further).

I don't think it uses fork, as I don't think windows *has* a real fork.
Perl's fork on windows is emulated using threads, but I doubt they used
used that emulation to implement system(1,...).  The point of having
a special system(1,..) on Windows is to use a technology which is better
matched to the underlying OS.

> But anyway, where is this behavior documented? The perl doc on the
> system command doesn't appear to it mention at all.

It is in the "system" section of perldoc perlport.  It probably should
be mentioned under perldoc -f system as well, and maybe perldoc -q
background.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.


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

Date: Fri, 20 Jun 2008 16:41:14 +0000 (UTC)
From: Willem <willem@stack.nl>
Subject: Re: Emulating system('COMMAND &') on Windows without using fork()
Message-Id: <slrng5nnda.4lr.willem@snail.stack.nl>

Jacob JKW wrote:
) The post to which you're replying was my reply to xhos post where he
) had suggested system(1,COMMAND);
)
) I was asking where *that* was documented.
)
) Perhaps I need a better news client than Google. ;)

Nope, that was my fault, I replied to the wrong post.  Sorry.


SaSW, Willem
-- 
Disclaimer: I am in no way responsible for any of the statements
            made in the above text. For all I know I might be
            drugged or something..
            No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT


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

Date: Fri, 20 Jun 2008 09:56:46 -0700 (PDT)
From: Jacob JKW <jacobcdf@yahoo.com>
Subject: Re: Emulating system('COMMAND &') on Windows without using fork()
Message-Id: <41127641-c3ee-4a87-b2a6-21f147233b59@e39g2000hsf.googlegroups.com>

On Jun 20, 12:39=A0pm, xhos...@gmail.com wrote:
> Jacob JKW <jacob...@yahoo.com> wrote:
> > On Jun 20, 11:40=3DA0am, xhos...@gmail.com wrote:
> > > Jacob JKW <jacob...@yahoo.com> wrote:
> > > > I'm trying to emulate the UNIX behavior of system('COMMAND &') =3DA=
0on
> > > > Windows without having to use fork().
>
> > > Have you tried:
>
> > > system(1,'COMMAND')
>
> > > I don't if it will work for your purposes, but it's the first thing I=
'd
> > > try.
> > But anyway, where is this behavior documented? The perl doc on the
> > system command doesn't appear to it mention at all.
>
> It is in the "system" section of perldoc perlport. =A0It probably should
> be mentioned under perldoc -f system as well, and maybe perldoc -q
> background.
Yeah, if that had been added to perldoc -f system that certainly would
have made my life a lot easier.

Thanks again for all your help. :)


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

Date: Fri, 20 Jun 2008 17:49:58 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Emulating system('COMMAND &') on Windows without using fork()
Message-Id: <mm3ti5-0kd.ln1@osiris.mauzo.dyndns.org>


Quoth Jacob JKW <jacobcdf@yahoo.com>:
> On Jun 20, 11:40 am, xhos...@gmail.com wrote:
> > Jacob JKW <jacob...@yahoo.com> wrote:
> > > I'm trying to emulate the UNIX behavior of system('COMMAND &')  on
> > > Windows without having to use fork().
> >
> > Have you tried:
> >
> > system(1,'COMMAND')
> >
> > I don't if it will work for your purposes, but it's the first thing I'd
> > try.
> No, I hadn't tried it, but very preliminary testing looks promising.
> (I only fear that it may still be a fork() behind the scenes -- I'll
> have it to test that further).

It doesn't. It is an ancient ActiveState hack to directly invoke Win32's
spawn* family of functions.

> But anyway, where is this behavior documented? The perl doc on the
> system command doesn't appear to it mention at all.

perlport, under "Function Descriptions/system". Not perhaps the first
place one would look, but if you're using perl on a non-Unix platform
you really need to read perlport all the way through.

Ben

-- 
For far more marvellous is the truth than any artists of the past imagined!
Why do the poets of the present not speak of it? What men are poets who can
speak of Jupiter if he were like a man, but if he is an immense spinning
sphere of methane and ammonia must be silent? [Feynmann]     ben@morrow.me.uk


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

Date: Fri, 20 Jun 2008 10:33:42 -0500
From: brian d  foy <brian.d.foy@gmail.com>
Subject: Re: FAQ 8.2 How come exec() doesn't return?
Message-Id: <200620081033425018%brian.d.foy@gmail.com>

In article <g3dq81$fnt$1@newshost.mot.com>, Mario D'Alessio
<dalessio@motorola.NOSPAM.com> wrote:


> > 8.2: How come exec() doesn't return?

> This FAQ answer should probably be expanded to mention
> fork() as well, since the user of exec() may have wanted
> to start another process but keep the original one, too.

Good idea. I'll add taht to my queue of things to work on.

Thanks,


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

Date: 20 Jun 2008 15:49:19 GMT
From: xhoster@gmail.com
Subject: Re: FAQ 8.2 How come exec() doesn't return?
Message-Id: <20080620114920.757$Hg@newsreader.com>

Bill H <bill@ts1000.us> wrote:
>
> Here is the issue, maybe you all will have a solution.
>
> In a perl cgi, I would like to do some file maintenance (remove old
> temporary files, session files etc) when a user accesses a program but
> I don't want to make them wait for it. Which command would I use to
> invoke a different perl program that is totally detached from the
> running one (runs in the background) and could still be running when
> the user is finished with the original program and not cause any delay
> (other than using more resources on the server) in the original
> program.

On Linux, you would fork a new process.  The new process needs to close
or reopen its copy of STDOUT and possibly STDERR.  If that is not done,
then the httpd server will assume there will be more stuff for it to pass
on to the browser.

You may also want to use POSIX::setsid, but I've not found that necessary.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.


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

Date: Fri, 20 Jun 2008 10:32:50 -0700 (PDT)
From: Bill H <bill@ts1000.us>
Subject: Filtering a string
Message-Id: <3c21d7a1-590c-419a-8821-106551411ab9@j22g2000hsf.googlegroups.com>

Can someone point me to some docs on how I would do this without
iterating over the whole string (pattern matching?):

$original = "a malformed%string/containi\"ng characters I don'~t
want! ...";

$filter = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-_";

$new = &fix($original);

$new would now equal:

amalformedstringcontainingcharactersidontwant

sub fix
{
my $o = shift;
my $r = "";
my $i = 0;
for($i = 0;$i < length($o);$i++)
{
if(index($filter,uc(substr($o,$i,1))) != -1){$r .= substr($o,$i,1);}
}
return($r);
}

I just typed this in to give you the gist of what I want to do so if
there are errors it is in my typing.

Bill H


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

Date: Fri, 20 Jun 2008 19:44:37 +0200
From: Dave B <daveb@addr.invalid>
Subject: Re: Filtering a string
Message-Id: <g3gqel$t21$1@registered.motzarella.org>

Bill H wrote:

> Can someone point me to some docs on how I would do this without
> iterating over the whole string (pattern matching?):
> 
> $original = "a malformed%string/containi\"ng characters I don'~t
> want! ...";
> 
> $filter = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-_";
> 
> $new = &fix($original);
> 
> $new would now equal:
> 
> amalformedstringcontainingcharactersidontwant

Is the following acceptable for you?

$new = lc(join("",grep(m/[$filter]/i,split(//,$original))));

-- 
D.


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

Date: Fri, 20 Jun 2008 18:48:32 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Filtering a string
Message-Id: <g47ti5-0if.ln1@osiris.mauzo.dyndns.org>


Quoth Bill H <bill@ts1000.us>:
> Can someone point me to some docs on how I would do this without
> iterating over the whole string (pattern matching?):
> 
> $original = "a malformed%string/containi\"ng characters I don'~t
> want! ...";
> 
> $filter = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-_";
> 
> $new = &fix($original);
> 
> $new would now equal:
> 
> amalformedstringcontainingcharactersidontwant

$orginal =~ tr/a-zA-Z0-9_-//cd;

See tr/// under 'Regexp Quote-Like Operators' in perlop.

Note that '-' must come first or last, as otherwise it will be
interpreted as part of an X-Y range.

Ben

-- 
For far more marvellous is the truth than any artists of the past imagined!
Why do the poets of the present not speak of it? What men are poets who can
speak of Jupiter if he were like a man, but if he is an immense spinning
sphere of methane and ammonia must be silent? [Feynmann]     ben@morrow.me.uk


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

Date: Fri, 20 Jun 2008 15:09:59 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Learning Perl
Message-Id: <x71w2s3zxz.fsf@mail.sysarch.com>

>>>>> "JC" == Jim Cochrane <allergic-to-spam@no-spam-allowed.org> writes:

  JC> On 2008-06-19, Jim Cochrane <allergic-to-spam@no-spam-allowed.org> wrote:
  >> On 2008-06-18, Gordon Corbin Etly <g> wrote:
  >>> Uri Guttman wrote:
  >>>>>>>>> "GCE" == Gordon Corbin Etly <g....c.e@gmail.com> writes:
  >>>> > Uri Guttman wrote:
  >>>> >>>>>>> "GCE" == Gordon Corbin Etly <g....c.e@gmail.com> writes:
  >>> 
  >>>> > > see you don't get it. it isn't broken behavior but behavior that
  >>>> > > shouldn't have been there to begin with. like my $x = 1 if 0 stuff
  >>>> > > which does something that was bad but not deprecated until
  >>>> > > recently.
  >>> 
  >>>> > I do get it. Maybe tell nose thumbing would allow us to understand
  >>>> > each other better.
  >>> 
  >>>> huh?? and you don't get it. otherwise you wouldn't have been defending
  >>>> the undefensible for so long. and i don't get that you even
  >>>> acknowledge you were wrong about it.
  >>> 
  >>> ...
  >>> 
  >>> I wasn't really disputing the documentation, though; I just feel it can 
  >>> be useful to test weather an array or hash has been given a value since 
  >>> it's inception, or if it has been run through the undef() function.
  >>> I can thing of a few scenarios where it maybe be useful to able to check 
  >>> for such a state separately from being just empty, much like one might 
  >>> test for undef vs. 0 or "".
  >> 
  >> What do you mean by "given a value"?  Do you mean "has memory for the
  >> array [or hash] been allocated?"?
  >> 
  >> If so, when you that knowledge be useful in a program?

  JC> Ugh - correction:

  JC> If so, when do you think that knowledge would be useful in a program?

i will be amazed and dazzled if he comes up with a use that all of p5p
and thousands of experienced perl hackers never thought of
before. considering that defined and undef are scalar concepts and
always have been, any use for them on aggregated is beyond our mortal
comprehension.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


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

Date: Fri, 20 Jun 2008 13:06:29 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Learning Perl
Message-Id: <86prqcrnfe.fsf@lifelogs.com>

On Fri, 20 Jun 2008 15:09:59 GMT Uri Guttman <uri@stemsystems.com> wrote: 

UG> i will be amazed and dazzled if he comes up with a use that all of p5p
UG> and thousands of experienced perl hackers never thought of
UG> before. considering that defined and undef are scalar concepts and
UG> always have been, any use for them on aggregated is beyond our mortal
UG> comprehension.

This makes some sense to me from a Lisp perspective, where nil is an
empty list and a null value at the same time.  Because Perl lists and
hashes are so different from Lisp structures, though, it just doesn't
translate well.  In Lisp it can lead to some wonderfully concise code:

(cond
 ((null v) ...)    ; it's empty
 ((stringp v) ...) ; it's a string
 ((listp v) ...)   ; it's a list
 ((t) ...))        ; anything else

Implementing the same in Perl 5 is not as nice.

Ted


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

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 V11 Issue 1662
***************************************


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