Why am I seeing garbage in getEncodedString() whereas changeEncoding() shows correct value. I think this has something to do with the way perl stores the variable during function return.my changeEncoding { my $self = shift; my $stringToEncode = shift; my $EncodedString = Encode::utf8_encode{'$stringToEncode'}; print " $EncodedString "; <-- absolutely fine here . return $EncodedString; } sub getEncodedString { my $encodedString = changeEncoding(MultiByteChar); print $encodedString ; <--This is garbage here. }
In reply to MultiByte Char handling in perl by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |