foreach $x ('a' .. 'z') {$alph->{$y} = $x; $y++;}
foreach (0 .. 25) {$b = rand 25; $alph->{int $b}, "\n";}
This will print out 25 random letters from the hash...you can change that to print out however many you want.
Maurice
Seriously, there's no advantage in using a hash with ascending numeric keys corresponding to the letters of the alphabet (especially as you use zero as a base) over a simple array.
The array is faster and slightly easier to read, too, not to mention much easier to initialize:
my @letters = (a .. z);
Duh...I should have realized that. It seemed fine when I ran it, but looking at the other versions, I see now my mistake! :) Still not bad for a Perl newbie. I did not partake of one of the three virtues: laziness. doh! thanks for the insight.
-Maurice