Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: Re: Find unique elements in an arrayby kappa (Chaplain) |
on Apr 04, 2004 at 21:04 UTC ( [id://342519]=note: print w/replies, xml ) | Need Help?? |
As per ccn's comment below, @unique{@a} = 1 looks weird and effectively equals to this: $unique{$a[0]} = 1; undef(@unique{@a[1..$#a]});, which, BTW, is good, as, according to tilly, storing lots of undefs instead of 1's in a hash to create keys is a Good Thing(tm) for performance.
In Section
Cool Uses for Perl
|
|