Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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?
[stevieb]: yeah digital potentiometer
[hippo]: Sounds fun. Good luck with it all.
[stevieb]: Thank you. I've got nearly all of it polished up, and have learned a boat load of things through the process

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (13)
As of 2017-01-20 16:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (176 votes). Check out past polls.