in reply to Working With Arrays and Files

You've got a good start! What you'll probably want to do is create a hash with the 6th column as keys and the other columns as values. It might end up being a Hash of Arrays of Arrays, like this:
my %hash; while (my $line = <TEMP>) { chomp($line); my @columns = split ' ', $line; # Add an array of the first four columns to the hash # entry for this type (the type is $columns[5]). Each # hash entry is itself an array of these arrays. push @{$hash{$columns[5]}}, [ @columns[0..4] ]; } # Go through the type names in order, printing out all the # data that was seen with each type foreach my $type (sort keys %hash) { print "$type\n"; foreach my $line (@{$hash{$type}}) { print "@$line\n"; } }
That may seem pretty complicated if it's your first Perl program. In order to understand exactly what's going on, try reading perlref and perldata to understand more about complicated data structures.

-- Mike

--
just,my${.02}