Created
October 4, 2015 16:27
-
-
Save autarch/b9264b8daa59358d25c3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sub _dump_with_unicode ($self, $val) { | |
| my $dumped = Dumper($val); | |
| $dumped | |
| =~ s/\\x\{([^}]+)\}/$self->_unicode_char_for($1)/eg; | |
| return $dumped; | |
| } | |
| sub _unicode_char_for ($, $hex) { | |
| my $num = eval '0x' . $hex; | |
| die $@ if $@; | |
| return '\N{U+' . sprintf( '%04x', $num ) . '}'; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment