- or download this
$a + ++$a
- or download this
0 + $a++
- or download this
$a + $a++
- or download this
#!/usr/bin/perl -w
use strict;
...
++$a + $a++ =3 $a= 2
$a++ + ++$a =2 $a= 2
$a+=$a++ =1 $a= 1
- 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?)
- or download this
$a + $a + ++$a + $a++ # = 2 (correct!)
0 + ++$a + $a++ # = 3 (d'oh!)