while (<>) { my @record = split /,/; my $key = shift @record; $list{$key} = [@record]; }