With perl -e '$string="a";print ++$string;' we get b,
but with perl -e '$string="b";print --$string;' we get -1.
So, if we can increment why can’t we decrement?
EDITED
“The auto-decrement operator is not magical” by perlop
Perl give us lots of facilities, why not this one? This is not criticism, but wouldn’t be expected similar behavior for similar operators? Is there any special reason?
perlop(1) explains that this is true, but doesn’t give a rationale:
The reason you get -1 is because when interpreted as a number, “b” turns into 0 since it has no leading digits (Contrarily, “4b” turns into 4).