# how many words to write. my $length = $ARGV[0] || 20; # dictionary file to use. my $dict = '/usr/share/dict/words'; open DICT, '<', $dict or die "Cannot open dictionary file: $!\n"; chomp(my @list = ); close DICT; print $list[rand(@list)], ' ' for (1 .. $length);