my @a = qw(1 11); my @b = qw(1a 2b); ($a,$b) = qw(11 a); print "Why am I printing?$/" unless (exists { map { $a[$_].$b[$_] => $ +_ } 0..$#a }->{$a.$b});
Of course, if you can guarantee @a contains only numerals and @b contains no numerals, then your solution works as advertised. However, this solution does break down when either array can contain any character.
In reply to Re: Re: Finding a match between two paired arrays
by Anonymous Monk
in thread Finding a match between two paired arrays
by Sandy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |