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:
Eirik Berg Hanssen
Date:
November 23, 2011 11:24
Subject:
Re: [perl #6847] strange behaviour when forking lots of times
Message ID:
CAHAeAG6Q=UJmsLDqP7=Q4Q9_0c8pxXU2FBbvhL2wfhCrZM9U6A@mail.gmail.com
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 ...

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$


  Funny? :)


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