Don't ask to ask, just ask | |
PerlMonks |
Re^2: matching values in arraysby Excalibor (Pilgrim) |
on Dec 14, 2004 at 11:25 UTC ( [id://414681]=note: print w/replies, xml ) | Need Help?? |
This solution is nice, and the hash is probably the way to go with it, but if the arrays contain repeated numbers, (i.e. their intersection is not void) it will probably fail (as it will always mark the last array, instead of the first one, or all of them)... Expanding your solution a bit will yield this:
which is more generic and works even if the numbers are shared by any of the arrays... Great idea, anyway! --
In Section
Seekers of Perl Wisdom
|
|