foreach(@correctguesses) { splice(@their_guess,$_,1); } foreach(@getridofthese) { splice(@newpattern_to_match,$_,1); }