See. the grep docs for more info.if( grep { $a == $a[$_] && $b eq $b[$_] } 0 .. $#a ) { # do stuff here }
Update: and here's the cleaner approach using List::Util's first (as kindly pointed out by Zed_Lopez below)
if( first { $a == $a[$_] && $b eq $b[$_] } 0 .. $#a ) { # do stuff here }
_________
broquaint
In reply to Re: Finding a match between two paired arrays
by broquaint
in thread Finding a match between two paired arrays
by Sandy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |