in reply to read the file and assign each line to a hash????
my %hash; open FH, "<", "/path/to/file" or die "Can't open file: $!"; while(<FH>) { chomp; if($_ =~ m/^([^:]+): (.*)$/) { $hash{$1} = $2; } } close FH;
|
---|
In Section
Seekers of Perl Wisdom
in reply to read the file and assign each line to a hash????
my %hash; open FH, "<", "/path/to/file" or die "Can't open file: $!"; while(<FH>) { chomp; if($_ =~ m/^([^:]+): (.*)$/) { $hash{$1} = $2; } } close FH;
|
---|