use strict; use warnings; my @a = ('b' .. 'j'); my $str = 'a' x 23; $str =~ s/a/$a[rand@a]/ge; print "$str\n"; #### dbjgcegjgieigecihebhdih