use Bytes::Random::Secure qw( random_string_from ); my $string = random_string_from( join( '', ( 'a' .. 'z' ), ( 'A' .. 'Z' ), ( '0' .. '9' ) ), 56 ); print $string, "\n"; # Done; no md5 bias, no modulo bias, strong seeding, strong CSPRNG.