in reply to Re: Understanding how to fork properly.
in thread Understanding how to fork properly.

if some bonehead set it to -1 previously, the increment op wouldn't be doing the wrong thing.

Oops! No. $| is magic. It always equals either zero or one. Nothing else. Behold:

print "$|\n"; # 0 $| = -1; print "$|\n"; # 1 $|++; print "$|\n"; # 1 $|++; print "$|\n"; # 1 $|--; print "$|\n"; # 0 $|--; print "$|\n"; # 1 $|--; print "$|\n"; # 0
As you can see, $|++ always sets $| to one (no matter what it was) and $|-- always toggles it.

------------------------------------------------------------
"Perl is a mess and that's good because the
problem space is also a mess.
" - Larry Wall