Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Re: Understanding how to fork properly.

by dvergin (Monsignor)
on Jan 31, 2002 at 04:07 UTC ( [id://142360]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-04-26 06:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found