in reply to Re: Idiom: hashes as sets
in thread Idiom: hashes as sets
Ok, you've piqued my curiosity ... I've looked both at the perl and the XS versions of uniq, and can't discern the difference between it and the idiomatic my %seen; @uniq = grep {not $seen{$_}++} @random_values. Though, I have to grant that it took me an inordinate amount of time to figure out the difference in the XS code between the scalar context codepath and the list context codepath, so I could easily be missing a subtle nuance somewhere. Care to be more explicit in which way the idiomatic method is wrong?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Idiom: hashes as sets
by kyle (Abbot) on Jul 03, 2008 at 16:14 UTC | |
by vrk (Chaplain) on Jul 04, 2008 at 08:27 UTC |