Change loop to:
foreach $string(@array) { my $found = 0 ; foreach $string2(@original) { if ($string eq $string2) { $found = 1; } } if ($found == 0) { print "$string not found\n"; } else { print "$string found\n"; } }
Also use strict and warnings ...
In reply to Re: Search in array from match in another array, print once only.
by tmharish
in thread Search in array from match in another array, print once only.
by satans-nightmare
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |