use 5.011; use Path::Tiny; my $n = 10; my @board = map{ [('.') x $n] } 0..($n-1); print "Empty board:\n"; foreach my $row(@board){ foreach my $col( @$row ){ print $col; } print "\n"; } use List::Util qw( shuffle ); my @letters = split //, 'aaaaaaaaabbccddddeeeeeeeeeeeeffgggghhiiiiiiiiijkllllmmnnnnnnooooooooppqrrrrrrssssttttttuuuuvvwwxyyz'; my @tiles = ( shuffle @letters )[0 .. 6]; print "tiles: @tiles\n"; my $pattern = join '', map "$_?", sort @tiles; my @matches = grep join('', sort split //) =~ /^$pattern$/, grep /^[@tiles]{2,}\z/ && /[aeiouy]/, # lc, size & vowel path('c:\users\tblaz\documents\html_template_data\dict\enable1.txt')->lines({chomp => 1}); print "\nmatches:\n\n@matches\n"; __END__