in reply to Re^2: Getting different results with $var++ and $var += 1
in thread Getting different results with $var++ and $var += 1
So is it possible for the ++ operator to increment a value that cannot be seen in numeric context?
Numerical context refers to the conversion of an operand's value to a number by operators that work on numbers. Perl can get a number from any value. The process might result in a warning and the result might be useless, but it will always end up with a number. That means there is no value that cannot be seen in numeric context. That means your question doesn't make sense.
On a side note, "++" handles strings differently than other values.
>perl -wle"$a='a'; print $a+=1" Argument "a" isn't numeric in addition (+) at -e line 1. 1 >perl -le"$a='a'; print ++$a" b
|
|---|