Help for this page

Select Code to Download


  1. or download this
    $a + ++$a
    
  2. or download this
    0 + $a++
    
  3. or download this
    $a + $a++
    
  4. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
    ++$a + $a++    =3    $a= 2
    $a++ + ++$a    =2    $a= 2
    $a+=$a++    =1    $a= 1
    
  5. or download this
    $a + $a + $a++ # = 0 (correct)
    $a + $a + ++$a # = 1 (correct)
    $a + $a++ + $a # = 2 (the trailing $a has no effect maybe?)
    $a + ++$a + $a # = 3 (the ++ effects previous $a as before?)
    
  6. or download this
    $a + $a + ++$a + $a++ # = 2 (correct!)
    0 + ++$a + $a++ # = 3 (d'oh!)