The difference with $Data::Dumper::Useperl = 1; is related to strings that can be represented entirely without utf8. On ingest eval makes the usual perl heuristic about utf8, and gets it wrong:
#!/usr/bin/perl -w use utf8; # so source code is utf-8 encoded use Data::Dumper; $data1 = 'ä ☺'; # a-umlaut, space, smiley $data2 = 'ä '; # a-umlaut, space, space $Data::Dumper::Useperl = 1; $dump1 = Dumper( $data1 ); print $dump1; $dump2 = Dumper( $data2 ); print $dump2; print "\n"; $Data::Dumper::Useperl = 0; $dump1 = Dumper( $data1 ); print $dump1; $dump2 = Dumper( $data2 ); print $dump2; print "\n";

Output

$VAR1 = "\x{e4} \x{263a}"; $VAR1 = 'ä '; $VAR1 = "\x{e4} \x{263a}"; $VAR1 = "\x{e4} ";

In reply to Re: Data::Dumper and utf8 by brycen
in thread Data::Dumper and utf8 by thedi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.