use strict; use warnings; my $num = <>; my @str = ('a'..'m','o'..'z'); my $cap = $str[int(rand 25)]; for(1..$num){ print $cap; for(1..int(rand 19)){ print $str[int(rand 25)]; } $cap = $str[int(rand 25)] . ($_ == $num ? 'n' : ''); print $cap."\n"; }