# The original subroutine rot13sub "orig", sub { # as close as possible to source project's code join '', map { exists $rot{$_} ? $rot{$_} : $_ } split('',shift); }; # Firstly, let's fill in the defaults in the hash table so that we # can use a hash slice my %rotd = %rot; exists($rotd{$_}) or $rotd{$_} = $_ for map chr, 0 .. 255; rot13sub "hashslice-s", sub { join '', @rotd{split('',shift)}; };