in reply to Re^2: Retrieving data with largest count
in thread Retrieving data with largest count

No it doesn't??? In:
1ct9B 3 1 1f7uA 2 3 1gaxA 2 1 1gpmA 3 5 1ihoA 6 4 1mopA 6 3 1ileA 2 5 1iq0A 2 3 1vlhB 5 3 1jhdA 5 4 ASDF 1 0 ASDF 1 -3

Out:

1ihoA 6 4 ASDF 1 0 1gpmA 3 5 1ileA 2 5 1jhdA 5 4

0 >= -3, so next is executed, so the record for -3 is ignored. The item with the highest value for group 1 (ASDF 1 0) is printed.

Replies are listed 'Best First'.
Re^4: Retrieving data with largest count
by Limbic~Region (Chancellor) on Jun 02, 2009 at 17:23 UTC
    ikegami,
    You replied to yourself and not me I didn't see the response initially. I must be having a second Monday. I read the following code:
    next if $largest{$group_id} && $largest{$group_id}[2] >= $count;
    as
    next if $largest{$group_id}[2] && $largest{$group_id}[2] >= $count;
    Obviously not having a computer at home for a month and a trip to Vegas to boot has shrunk what little brain cells I have.

    Cheers - L~R

      You replied to yourself and not me (didn't see the response initially).

      No, I didn't...

      I must be having a second Monday.

      Indeed!