Skip to content

Instantly share code, notes, and snippets.

@uasi
Created December 14, 2010 13:44
Show Gist options
  • Save uasi/740430 to your computer and use it in GitHub Desktop.
Save uasi/740430 to your computer and use it in GitHub Desktop.
use v6;
module Foo {
my %escape;
for 0 .. 255 -> $c {
%escape{ chr($c) } = sprintf('%%%02X', $c);
}
our 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