sub make_tr { my ($from, $to, $opts) = map defined && quotemeta, @_; $opts = "" unless defined $opts; return eval "sub { (defined \$_[0] ? \$_[0] : \$_) =~ tr/$from/$to/$opts }" or die $@; }