Perl-Sensitive Sunglasses | |
PerlMonks |
Re (tilly) 2: A C-like brain in a Perl-like worldby tilly (Archbishop) |
on Sep 27, 2001 at 00:01 UTC ( [id://114927]=note: print w/replies, xml ) | Need Help?? |
Using keys in this way causes stringification of values. If your arrays have objects or references in them, this will bite. Also note that that 2 for 1 map was slow until Perl 5.6.1. The following is therefore how I do that:
Side benefit? I don't lose the order of the incoming elements. :-) But, as with all hash approaches, my definition of "unique" is "stringifies the same". That is not always the appropriate definition to use.
In Section
Seekers of Perl Wisdom
|
|