On Mon, 4 Feb 2002 11:30:08 +0900, Nobumi Iyanaga wrote:

>If, for example I hava a list of page numbers like this:
>
>(343, 512, 71, 562, 346, 345, 513, 561, 563, 343, 513, 549, 562, 71, 76, 
>345, 510, 563)

I've been wondering about this. How on earth did you get to this list?
I'm in the same line of business, and the way I'd do it, is:

        # foreach $keyword, $page pair:
            $index{$keyword}{$page}++;
        # end foreach pair

and thus, to get a proper list for each keyword, I just need to do:
        
        my $string = join ', ', sort { $a <=> $b }
            keys %{$index{$keyword}};

(The hash values don't matter.)

As you can see: no duplicates.

My guess is that you started out with a push() onto an array, per page.

-- 
        Bart.

Reply via email to