Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: how come both the if and elsif block getting executed ?

by zentara (Archbishop)
on Apr 20, 2014 at 17:50 UTC ( [id://1082955]=note: print w/replies, xml ) Need Help??


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 ?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1082955]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (7)
As of 2024-04-19 08:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found