in reply to Finding a match between two paired arrays
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Finding a match between two paired arrays
by Zed_Lopez (Chaplain) on Jan 08, 2004 at 15:49 UTC | |
by duff (Parson) on Jan 08, 2004 at 15:53 UTC |