Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Pre vs Post Incrementing variables

by SavannahLion (Pilgrim)
on Sep 12, 2010 at 07:22 UTC ( [id://859811]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $i = 0;
    my ($j, $k) = (++$i, ++$i); #Pre-increment
    print "\$j: $j\t\$k: $k\n";
    
  2. or download this
    $j: 2    $k: 2
    
  3. or download this
    $j: 1    $k: 2
    
  4. or download this
    my $i = 0;
    my ($j, $k) = ($i++, $i++); #Pre-increment
    print "\$j: $j\t\$k: $k\n";
    
  5. or download this
    $j: 0    $k: 1
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://859811]
Approved by zwon
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found