Because the
$cnt variable is incremented in the child, it won't effect the parent (as they're two separate processes). So you can either increment before forking and hope the children are processed in the order they were forked (quite likely in your case), or get the child processes to communicate back to the parent process the incrementing of
$cnt (or even have the
CHLD handler increment it). See.
perlipc for more info on the latter option and
kill for passing about signals.
As for the and next the docs say
The "and next" skips the internal loop in the parent process.
So without it you don't move onto the next child process (if my thinking is correct).
HTH
_________
broquaint