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;