in reply to How to avoid printing duplicates

When you think duplicate, think hash.

untested:

my %patterns; if (!($patterns{"$line, $match, $link"})) # if not yet in the has +h { print $line, $match, $link, "\n"; # print it $patterns{"$line, $match, $link"} = 1; # ... and add it to the + hash }
HTH, Rata

Replies are listed 'Best First'.
Re^2: How to avoid printing duplicates
by Anonymous Monk on Dec 05, 2010 at 03:07 UTC
    I think he meant each variable may be a duplicate of the next, in which case it would be slightly more complex, but that principle (hashes) still does apply.