use strict; use warnings; my @names; my @comments; my %hrec; while (){ chomp; my ($name,$comment) = split ","; $name =~ s/"//g; $comment =~ s/"//g; push @names,$name; push @comments,$comment; } $hrec{'Names'} = @names; $hrec{'Comments'} = @comments; #### # $hrec{'Names'} = @names; # $hrec{'Comments'} = @comments; $hrec{'Comments'} = \@names; $hrec{'Names'} = \@comments; #### $hrec{'Names'}->[0]; ## Isha $hrec{'Comment'}->[0]; ## Hello!! ; #### my %hrec; while (){ chomp; my ($name,$comment) = split ","; $name =~ s/"//g; $comment =~ s/"//g; $hrec{$name} = $comment; }