use strict; use warnings; my $a = 10; my $b = 10; #IMHO: $a-- should finish the current operation and then -1 if ($a == $b--) { print "\n T1"; } $b=10; #IMHO: --$a should -1 first and continute with current operation , i.e if compare if ($a == --$b) { print "\n T2"; } #ENV: #Active Perl 5.20, Windows 7, x64 #Output # T2 #### my $foo = 1; # post decrement (printed and then decremented to 0) print $foo--; # prints 1 print $foo; # prints 0 #### my $foo = 1; # pre-decrement (decremented to 0 then printed) print --$foo; # prints 0 print $foo; # prints 0