Perl: Autoincrement
Autoincrement
$b = $a++; # $a is equal to 7, but $b is equal to 6
$c = ++$b; # $b and $c are equal to 7
To increment a variable by 1, use the ++
$b = $a--; # $a is equal to 3, but $b is equal to 4
$c = --$b; # $b and $c are equal to 3
To decrement a variable by 1, use --