in reply to a new example

You'll want to add:
use feature 'unicode_strings'; use open qw(:std :utf8); use utf8;

To the top of your script to enable Unicode support.

Alternatively you could use utf8::all from CPAN which handles even more Unicode edge cases, and can be included in your script in a single line

Replies are listed 'Best First'.
Re^2: a new example
by chromatic (Archbishop) on Jul 28, 2013 at 23:46 UTC

    Only the open pragma fixes the problem. There's no literal (high bit) UTF-8 character in the source code, so the utf8 pragma does nothing here, and character interpolation is, to my knowledge, unaffected by the Unicode bug, so the unicode_strings feature does nothing to fix the problem here either.

    The problem is solely the missing encoding discipline on the output filehandle.