my @Book = (); my @MatchFound = (); foreach (@Book) if ( $_ =~ /\bPerl\b/i && /\bMonks\b/i && /\bRule\b/i ) { push @MatchFound, $_; }