in reply to Array of arrays?

This uses a hash-of arrays:
use warnings; use strict; use Data::Dumper; $Data::Dumper::Sortkeys=1; my %animals; while (<DATA>) { my @cols = split; next unless $cols[2] eq 'hyper'; push @{ $animals{$cols[0]} }, $cols[3]; } print Dumper(\%animals); __DATA__ alligator-n amphibian_reptile event sleep-v alligator-n amphibian_reptile event swim-v alligator-n amphibian_reptile event walk-v alligator-n amphibian_reptile hyper animal-n alligator-n amphibian_reptile hyper beast-n alligator-n amphibian_reptile hyper carnivore-n alligator-n amphibian_reptile mero foot-n alligator-n amphibian_reptile mero jaw-n

prints:

$VAR1 = { 'alligator-n' => [ 'animal-n', 'beast-n', 'carnivore-n' ] };

See also: