in reply to UTF8 with YAML or JSON
Instead of looking at Dumper($dat) you might find print length($dat->{x})."\n" enlightening.