http://www.perlmonks.org?node_id=1035963


in reply to example in book of Programming Perl does not work.

Hi yangy

I have tried the same, in my systems its works correctly. I am also using ubuntu only.

What PID is printing in the code?

print "\$pid is : $pid"

I am getting 0.

This line raises the error for you

die "cannot fork: $!" unless defined $pid;
All is well