snippet jonnybe While my GF was busy playing an online word scramble game, I decided to automate the process. I managed to get the initial script working in a few minutes then started to play with optimizing it. I managed to get a speed improvement of a factor of 6. Anyone have any further suggestions? For instance, is the regexp the right way to go? The dictionary used was a master dump from aspell for anyone who actually tries it out; one word per line. The letters to be unscrambled should be provided as space seperated command line arguments. (Stating the obvious I know!) <CODE> #! /usr/bin/perl -w use strict; my ( $word, $tmpword ); open DICT, 'wordlist' or die "Cannot open dictionary: $!"; while ( $word = <DICT> ) { next if ( length $word > $#ARGV + 2 ); chop $word; $tmpword = $word; foreach my $i ( @ARGV ) { $tmpword =~ s/$i//; } unless ( $tmpword ) { print "$word\n"; } } </CODE>