in reply to Re: Re: Need help with a Mastermind game
in thread Need help with a Mastermind game

Here's a shorter way to count the guesses in the right place:
my $tmp = $solution ^ $guess; my $right_place = $tmp =~ tr/\0//;
(In 5.6, I believe one can even skip the temporary variable.)