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
In reply to Re^3: Getting different results with $var++ and $var += 1
by ikegami
in thread Getting different results with $var++ and $var += 1
by splicer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |