in reply to Syntax for Hashes of Hashes

In the spirit of TWTOWTDOI, a variant of fmerges's solution to use hash slices:
my %g = (); my @innerKeys = qw/ specie gener age haircolor /; while(<INFO>) { my @vals = split /,/, $_; my $name = shift @vals; @{$g{$name}}{ @innerKeys } = @vals; }

On a related note, I happened to just now be working with similar code that additionally leverages Text::CSV so that you could have a line like "Mr. Jones, Jr.",human,male,47,gray
my $csv = Text::CSV->new(); open FILE, $filename or die "couldn't open file '$filename': $!"; # if the file has colnames in the first row, do this: $_ = <FILE>; $csv->parse($_); my @cols = $csv->fields(); # otherwise, manually define them: my @cols = qw/ name specie gener age haircolor /; while(<FILE>){ # let Text::CSV do the hard work. $csv->parse($_); # this turns blanks into undef's -- remove the "map {}" part if bl +anks are ok. my @vals = map { !defined($_) || $_ eq '' ? undef : $_ } $csv->fie +lds(); # This hashes the whole row my $row = { map { $cols[$_] => $vals[$_] } 0 .. $#cols }; # Now do whatever you need with it. $g{ $row->{name} } = $row; # Or a common/generic usage might be: push @rows, $row; }