Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to construct a hash like below,i dont see any errors but I dont see the hash getting constructed?Any idea?
use warnings; use strict; open (my $fh, '<', "data.txt") or die "could not open dirs.log $!; while (my $line=<$fh>) { $key = lc($line); $Hash{$key}=$line; } open my $hash, '>', "hash.txt"; print $hash Dumper( \%Hash ); close $hash;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Constructing a hash
by bart (Canon) on Mar 17, 2011 at 08:12 UTC | |
Re: Constructing a hash
by philipbailey (Curate) on Mar 17, 2011 at 08:16 UTC | |
Re: Constructing a hash
by Anonymous Monk on Mar 17, 2011 at 07:36 UTC | |
by Anonymous Monk on Mar 17, 2011 at 08:09 UTC | |
Re: Constructing a hash
by danwoods (Initiate) on Mar 17, 2011 at 15:02 UTC |
Back to
Seekers of Perl Wisdom