Skip to content

Instantly share code, notes, and snippets.

@lopnor
Created December 14, 2010 13:24
Show Gist options
  • Save lopnor/740400 to your computer and use it in GitHub Desktop.
Save lopnor/740400 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl6
use v6;
module Foo {
my %escape;
for 0 .. 255 -> $c {
%escape{ chr($c) } = sprintf "%%%02X", $c;
}
sub bar (Int $value) {
return %escape{ chr($value) };
}
}
say Foo.bar(150);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment