in reply to Hash from a file

AnonymousI've got a file that I need to read
into a hash line by line


Just map key/value directly into the hash:
... my %hash; open my $fh,'<', 'input.txt' or die "with style ($!)"; %hash = map /^Data_Type:([\S]+)\s*([^\n]+)/, <$fh>; # all happens her +e close $fh; ...
You can verify with:
... print "$_ = > $hash{$_}\n" for keys %hash; ...
Regards

mwa