sub foo { my ($from, $to) = @_; return sprintf($to, ($from =~ /.../)); }