use strict; use warnings; my $rot = 6; my $src = join '', 'a'..'z'; my $dst = substr($src, $rot) . substr($src, 0, $rot); my $tr = eval "sub { local \$_ = \@_ ? \$_[0] : \$_; tr/$src/$dst/; return \$_; }"; chomp(my $message = lc(<>)); $message = $tr->($message); print("$message\n");