Subject: | !LEAVE_SRC writes wrong data to original value |
In the following one-liner, encode() returns the string "ascii" but overwrites the source variable
with an empty string.
perl -MEncode -wle 'use strict; my $src = "ascii"; my $new = Encode::decode("UTF-8", $src,
Encode::FB_CROAK); print "new: $new"; print "src: $src"'
new: ascii
src:
It could be considered technically okay because the docs for Encode::LEAVE_SRC only say that
the source string will be "overwritten in place". It doesn't say what will overwrite it.