while ( $line = <> ) { chomp; my @field = split ', ', $line; my $key = encode( $field[0] ); $filedata{$key} = \@field; }