Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Bit operations for beginners

by liz (Monsignor)
on Aug 08, 2003 at 15:16 UTC ( #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
Node Status?
node history
Node Type: note [id://282213]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2014-09-16 23:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (53 votes), past polls