my $i = 0; # init $i and set to 0 print ++$i + 1; # answer: 1 (0 + 1) post-operation -> $i == 1 now print $i++ + 1; # answer: 3 (2 + 1) post-operation -> $i == 2 now print $i + $i++; # answer: 5 (2 + 3) post-operation -> $i == 3 now print ++$i + ++$i; # answer: 7 (3 + 4) post-operation -> $i == 7 now print ++$i + $i++ + 1; # answer: 17 (7 + 9 + 1) post-operation -> $i == 17 now #### perl -Mstrict -e ' my $i = 0; print ++$i + 1,"\n"; print $i++ + 1,"\n"; print $i + $i++,"\n"; print ++$i + ++$i,"\n"; print ++$i + $i++ + 1,"\n"; ' 2 2 5 10 14