use List::Util qw(shuffle); open my $dict, '<', '/usr/share/dict/words' or die $!; while(<$dict>) { my($word) = $_ =~ /^([a-z]{4,8})$/ or next; push @keys, $word; } @keys = shuffle(@keys);
my $cmnd = "/usr/games/banner -w 60 'The next token is $token'"; my @lines = map { chomp($_); s/\s+$//; $_ } `$cmnd`; die "Banner too long\n" if @lines > 512;