in reply to how come both the if and elsif block getting executed ?

You know, I never really questioned the syntax, but from my limited experience, it is a way actually executing the fork. The if($pid) part is true, if the system can fork and return a non-zero pid. So the fork occurs and the parent gets a pid, and the child receives a 0. It is the c way of forking. So both sections of code get executed, but one is in the parent and the other is the child.

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh
  • Comment on Re: how come both the if and elsif block getting executed ?