chickenlips has asked for the wisdom of the Perl Monks concerning the following question:

Obtained 8 random chars in a sub. Called it $random_string.

Input a word from user (that they make FROM the 8 random chars such as in Scrabble).

Gotta validate the inputted word by checking that it indeed consists of the chars in $random_string.

The KEY BIT I CANNOT FIGURE OUT IS: I need to check that any letters used in the randomly generated for the inputted word are only used ONCE.

Basically a simple version of Scrabble, this is what i have so far:

print "Please enter a word from the letters above: "; chomp(my $word = <STDIN>); #INPUT WORD if ($word =~ /[$random_string]$/i) { print "Good word\n"; last; } else { print "try again\n"; print "\n"; }