perlynewby has asked for the wisdom of the Perl Monks concerning the following question:
I don't seem to understand what is going on here with "dump" module. I expect to see the HASH but only returns the last key, value...why?what am I missing? please help me understand.
uno = uno due = dos tre = tres quattro = quatro cinque = cinco
use strict; use warnings; use Data::Dump qw(dump); my %hash; open my $in, '<',"./test_data.txt" or die ("can't open the file:$!\n") +; my $data; while (<$in>){ chomp; %hash= split (/\s*=\s/); #dump \%hash; #checking on what's being assigned to hash } close $in; #print "this is the data\n"; dump \%hash;
|
|---|