- or download this
use strict;
use warnings;
...
#Output
# T2
- or download this
my $foo = 1;
# post decrement (printed and then decremented to 0)
print $foo--; # prints 1
print $foo; # prints 0
- or download this
my $foo = 1;
# pre-decrement (decremented to 0 then printed)
print --$foo; # prints 0
print $foo; # prints 0