in reply to Preventing duplicate info from being pushed into an array
my @Book = (); my %MatchFound; foreach (@Book) { $MatchFound{$_}++ if ( /\bPerl\b/i && /\bMonks\b/i && /\bRule\b/i ); }
or even
my @Book = (); my %MatchFound = map{ $MatchFound{$_}++ if ( /\bPerl\b/i && /\bMonks\b +/i && /\bRule\b/i ) } @Book;
Both, alas, are untested...
|
|---|