in reply to Finding a match between two paired arrays
If the arrays stay the same, you only need to build the hash once:unless (exists { map { $a[$_].$b[$_] => $_ } 0..$#a }->{$a.$b}) { do_something(); }
%ab = map { $a[$_].$b[$_] => $_ } 0..$#a; ... unless (exists $ab{$a.$b}) { do_something() }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Finding a match between two paired arrays
by Anonymous Monk on Jan 08, 2004 at 18:24 UTC | |
by ysth (Canon) on Jan 08, 2004 at 19:49 UTC |