Posted on 2008-03-11 08:05:14-07 by andreys
Side effects of encoding::source
As of encoding::source v0.2, it still has side effect of propagating $^ENCODING from compile-time to run-time.

This may be serious if byte strings which contain 8th bit are incorporated as literals (i.e. quotes) after "use encoding::source". Perl feeds them trough "$^ENCODING->cat_decode".

Solution is to change:
else { $LATIN1->$method(@_); }
to something else. Options include returning un"decode"d data in cat_decode for out-of-scope case OR adding some "DESTROY()-itself" object as $^H{__PACKAGE__} value.

This bug report corresponds to my other message concerning encoding::warnings which has similar issue: http://www.cpanforum.com/posts/7304
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.