Your code does not work. After reading up on posting (Writeup Formatting Tips), try to run your code.
When I add use warnings; use strict;, there are warnings which give you a clue as to why it might be failing:
use strict;
use warnings;
use Data::Dumper;
my %hash;
open(FILEHANDLE, "<hash.dat") or die("boo! error");
while(<FILEHANDLE>) {
# print $_;
%hash = split(" ", <FILEHANDLE>);
}
print Dumper(\%hash);
__END__
Odd number of elements in hash assignment at .., <FILEHANDLE> line 2.
$VAR1 = {};
|