my @Book = (); my %MatchFound = map{ $MatchFound{$_}++ if ( /\bPerl\b/i && /\bMonks\b/i && /\bRule\b/i ) } @Book;