develooper Front page | perl.perl5.porters | Postings from November 2011

Re: [perl #6847] strange behaviour when forking lots of times

Thread Previous | Thread Next
From:
The Sidhekin
Date:
November 23, 2011 11:27
Subject:
Re: [perl #6847] strange behaviour when forking lots of times
Message ID:
CAHAeAG4K1feh79QAK97vB8aXFyUyrzNH18xfY+iwb16FdyaS2g@mail.gmail.com
On Wed, Nov 23, 2011 at 8:24 PM, Eirik Berg Hanssen <
Eirik-Berg.Hanssen@allverden.no> wrote:

> On Wed, Nov 23, 2011 at 8:12 PM, Eric Brine <ikegami@adaelis.com> wrote:
>
>> I'm not clear on why fork failing would cause $_ to be changed from 'a'
>> to 1.
>
>
>   Me neither, but it does.  Or rather, evaluating the fork in a boolean
> context does ...
>

  ... err, no, let's try again ... fork failing causes $_ to be changed
from 'a' to undef.  Evaluatin the fork in a boolean context changes it
(most likely further? or possibly instead?) to 1.



> eirik@bluebird[20:22:14]~/tmp$ ulimit -u 130
> eirik@bluebird[20:22:19]~/tmp$ perl -we '!fork, print for split //, "a" x
> 10' ; sleep 1; echo
> Useless use of not in void context at -e line 1.
> aaaaaaaaa1
> eirik@bluebird[20:22:22]~/tmp$ perl -we 'fork, print for split //, "a" x
> 10' ; sleep 1; echo
> aaaaaaaaaUse of uninitialized value in print at -e line 1.
>
> eirik@bluebird[20:22:38]~/tmp$
>


  Ayup.


Eirik

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About