Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Forking problems

by pc88mxer (Vicar)
on Mar 21, 2008 at 17:00 UTC ( [id://675470] : note . print w/replies, xml ) Need Help??


in reply to Re: Forking problems
in thread Forking problems

undef will evaluate to 0 in numeric context, so you'll really want:
if (!defined(my $pid = fork)) { print "Oh no\n"; } elsif ($pid == 0) { print "in child\n"; } else { print "in parent\n"; }