in reply to PV value
Ahh ... “Simplify! Simplify!!”
perl -e 'my $a; $a=4; $a eq "13"; $a++; print "$a\n";'
5
Or simply...
perl -e 'my $a; $a=4; $a++; print "$a\n";'
5
(You see, the do-nothing equality test does nothing ... It evaluates a result, which happens to be false, and then throws it away. Did that cause a to-string conversion side effect? Maybe, maybe not ... who cares.)
When you strip out all of the extraneous “fluff,” you assigned a variable the value 4, then incremented it, and wound up with 5.
Internally, like every good language system, Perl is always lazy. It won’t generate a string or even discard the old one until it has to, since even the microseconds required to do things like this can add up. (Especially memory management.) Macros and such are provided in the implementation to ensure (transparently to you...) that this “lazy” work has been done if it needs doing. Just use them, as they are meant to be used, and be done: if the currently stored value is stale, then it will be replaced before you get it such that what you get is never stale, and that’s all you need to be concerned with. Don’t be concerned, because then your code gets clever, and clever code works in-test but fails under-load.