for (my $n=0;;$n++) { print word($n),"\n"; } sub word($) { my $n =shift; return (($n>26)?word(int($n/26)):"").chr(97+$n%26); }