in reply to Removing redundancy in X and Y directions

Something like the following, untested, code:
my @top_level; my %seen; my @cache; while (<>) { chomp; my ($key, @thingies) = split /\t/; unless ($seen{$key}) { push @top_level, $key; $seen{$key} = {}; } push @{$cache{$key}}, grep {!$seen{$key}{$_}++} @thingies; } foreach my $key (@top_level) { say join "\t", $key, @{$cache{$key}}; }

Replies are listed 'Best First'.
Re^2: Removing redundancy in X and Y directions
by Anonymous Monk on Sep 27, 2008 at 18:46 UTC
    Thanks Guys for your excellent code!
    Freddie