in reply to Problems with complex structure and array of arrays

If I'm understanding you correctly, you could just collect things in a hash, keyed by the first column:

my %rows; while (<DATA>) { my ($key, $c1, $c2, $c3) = split; push @{ $rows{$key} }, "${c1}_$c2,$c3"; } for my $key (keys %rows) { print join("\t", $key, @{ $rows{$key} }), "\n"; } __DATA__ frog-n as novelty-n 5.8504 frog-n be yellow-n 6.1961 frog-n be-1 Asia-n 5.0937 frog-n coord zebra-n 5.9279 frog-n coord-1 Canuck-n 6.3363 frog-n nmod-1 mule-n 4.2881 amphibian-n success-1 surprising-j 14.6340 amphibian-n such_as alligator-n 11.5265 amphibian-n than work-n 5.9948 amphibian-n though stalk-n 13.2228

Output:

frog-n as_novelty-n,5.8504 be_yellow-n,6.1961 be-1_Asia-n,5. +0937 coord_zebra-n,5.9279 coord-1_Canuck-n,6.3363 nmod-1_mule +-n,4.2881 amphibian-n success-1_surprising-j,14.6340 such_as_alligator-n,11 +.5265 than_work-n,5.9948 though_stalk-n,13.2228

(Note that the rows in the unsorted hash printout are only "by accident" in the same order the keys occurred the input data.  In case ordering matters, you'd need to take care of it separately (e.g. using Tie::IxHash).)