in reply to making a text file to an hash array

my %hash; my $key; while ($_= <$file>) { my @line= split; while (@line) { my $part= shift @line; if ($part=~/^\D/) { #does not begin with a number $key= $part; $hash{$key}=[]; } else { $hash{$key}= split /,/,$part; } } }

Untested.

Your posting would look better if you surrounded code with <code> </code> tags by the way

Updated, forgot a loop