use List::Util qw( shuffle ); use strict; use warnings; my @upper = 'A'..'Z'; my @lower = 'a'..'z'; $_ = "What That April With His Shoures Soote The Drought Of Marche Hath Perced To The Roote "; $" = ''; eval "y/@upper@lower/@{[shuffle @upper]}@{[shuffle @lower]}/"; print