in reply to Re^4: Adding text file data to hashes and array
in thread Adding text file data to hashes and array

i am gettingvar$1={'apple-A'=>['30','40','50','60']}

That is the default Data::Dumper format. Use either

$Data::Dumper::Useqq = 1; print Dumper \%hash;

or dump the values as your original post.

for my $key (sort keys %hash) { printf "%-12s %s\n",$key,join ' ',@{$hash{$key}}; }
poj

Replies are listed 'Best First'.
Re^6: Adding text file data to hashes and array
by Anonymous Monk on Feb 15, 2019 at 12:05 UTC

    hi poj,the two lines of code are not working

      the two lines of code are not working

      Show the code you are running and the output or error message you get.

      poj