1) why/how does it skip the dupe?
It actually doesn't skip it. It's just that it is assigned as a key to a hash, and hash keys are unique, thus it overwrites the old key without doing harm.
2) what does assigning the 1 do?
It's just a random value, you could assign anything you like as a value to the hash. It's not important, as long as there's something there to make perl happy.
3) what does that 2nd line do to delete the key/value pairs of page => 1?
nothing. It now restores the AoH. Hmm, I didn't tidy up the "%uniq" hash if you thought of that.
Also, any good sources for learning how to disect a map/grep
Besides perldoc -f grep and perldoc -f map? Hmm. Reading Perlmonks... ;)
Cheers, Sören
In reply to Re^3: Is there better way to delete dups in an AoH?
by Happy-the-monk
in thread Is there better way to delete dups in an AoH?
by bradcathey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |