Skip to content

Instantly share code, notes, and snippets.

@clairvy
Created February 12, 2010 11:23
Show Gist options
  • Save clairvy/302482 to your computer and use it in GitHub Desktop.
Save clairvy/302482 to your computer and use it in GitHub Desktop.
#!/opt/local/bin/perl
use strict;
use warnings;
use Test::More tests => 2;
my $hoge1 = 'FF330';
my $expect = "\x{FF330}";
my @codes = (
sub {eval '"\x{' . $_[0] . '}"'},
sub {chr(hex($_[0]))},
);
foreach my $code (@codes) {
my $hoge2 = $code->($hoge1);
is($hoge2, $expect);
}
test:
@prove exp.pl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment