@links = filter(@links); sub filter { #pseudocode strip off any hashes because "foo.com/bar.htm#quux" is the same as "foo.com/bar.htm" strip off "index.html" and so on because "foo.com/index.html" is the same as "foo.com/" various other things ... NOW feed them through a hash to guarantee uniqueness NOW grep them against the %seen hash return whatever's left }
Every bit of code is either naturally related to the problem at hand, or else it's an accidental side effect of the fact that you happened to solve the problem using a digital computer.
M-J D
In reply to Re: Pushing unique items onto an array
by Cody Pendant
in thread Pushing unique items onto an array
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |