in reply to Constructing a hash
That should work for you.use strict; use warnings; use Data::Dumper; open (FH, "<data.txt"); my (%hash); while (my $line = <FH>) { my $key = lc($line); $hash{$key} = $line; } close(FH); open (FH, ">hash.txt"); print FH Data::Dumper->Dump([%hash]); close(FH);
|
|---|