How can I look for an exact pattern match. I would like to interrogate a pattern and remove exact matches out of the array which occur in another array. If I use (grep s/$temp/ /ig,@new_array) then it will remove all matches instead of exact matches. See example below. Any clues ?
use strict; my @array = qw (bga); my @new_array = qw (bga cbga test); print "@array\n"; foreach my $temp(@array) { chomp($temp); my $tester = grep s/$temp/ /ig,@new_array; } print "@new_array\n";
In reply to How to look for exact pattern match by juo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |