Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Bit operations for beginners

by liz (Monsignor)
on Aug 08, 2003 at 15:16 UTC ( [id://282213]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $a = 0;
    $b = 0;
    $c = $a++ && $b++;  # only $a++ is evaluated
    print "a = $a, b = $b\n";  # prints "a = 1, b = 0"
    
  2. or download this
    $a = 0;
    $b = 0;
    $c = ++$a || ++$b;  # only ++$a is evaluated
    print "a = $a, b = $b\n";  # prints "a = 1, b = 0"
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2024-04-18 17:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found