Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: strange behaviour when forking lots of times

by Dervish (Friar)
on May 16, 2006 at 08:05 UTC ( #549682=note: print w/replies, xml ) Need Help??

in reply to strange behaviour when forking lots of times

It took me a while to understand this code. As you may guess, I, too, am new at Perl but have had many years' work with C. From my C-programming perspective, I interpreted your code as forking and then (if you are the child) executing the command 'print for split (//, "a" x 10)' However, this is one of those areas where Perl is quite different from C. The 'for' is a statement modifier, and so affects the entire command. So 10 child processes are created, each of which forks 9 times, and so on. (Resulting in the 10! processes mentioned above). Just an alternate perspective from someone who's still new at this strange stuff. Dervish
  • Comment on Re: strange behaviour when forking lots of times

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2019-11-17 22:36 GMT
Find Nodes?
    Voting Booth?
    Strict and warnings: which comes first?

    Results (87 votes). Check out past polls.