Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
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 |