use Tie::File; tie my @word, 'Tie::File', '/usr/dict/words' or die $!; print "$word[rand @word]\n" for 1..10;