in reply to Re^2: Is there better way to delete dups in an AoH?
in thread Is there better way to delete dups in an AoH?
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Is there better way to delete dups in an AoH?
by bradcathey (Prior) on Jun 06, 2004 at 23:14 UTC | |
by Roy Johnson (Monsignor) on Jun 06, 2004 at 23:30 UTC | |
by bradcathey (Prior) on Jun 06, 2004 at 23:53 UTC | |
by bradcathey (Prior) on Jun 08, 2004 at 02:37 UTC | |
by Roy Johnson (Monsignor) on Jun 08, 2004 at 03:32 UTC | |
by bradcathey (Prior) on Jun 08, 2004 at 11:03 UTC | |
by qq (Hermit) on Jun 07, 2004 at 00:01 UTC | |
by hv (Prior) on Jun 07, 2004 at 01:31 UTC | |
by qq (Hermit) on Jun 08, 2004 at 00:18 UTC |