in reply to Re: problem path stored in hash
in thread problem path stored in hash
The config file looks like this:sub get_config { my %config; open (CONFIG, "$CONFIG_FILE") or die "Error: $!\n"; while (my $line = <CONFIG>){ # verbose($line); chomp($line); if($line =~ m/WORKING_DIR=(.*)/){ $config{"workingDir"} = $1; verbose("Working Dir: ".$config{"workingDir"}."\n"); }elsif($line =~ m/INPUT_FILE=(.*)/){ $config{"inputFile"} = $1; verbose("Input File: ".$config{"inputFile"}."\n"); }elsif($line =~ m/MAP_FILE=(.*)/){ $config{"mapFile"} = $1; verbose("Map file: ".$config{"mapFile"}."\n"); } } close(CONFIG); return %config; }
WORKING_DIR=/root/working/ INPUT_FILE=test.in MAP_FILE=test.map
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: problem path stored in hash
by cdarke (Prior) on Jun 25, 2010 at 10:09 UTC | |
by awsiv (Initiate) on Jun 25, 2010 at 11:02 UTC | |
by cdarke (Prior) on Jun 25, 2010 at 11:28 UTC | |
|
Re^3: problem path stored in hash
by jethro (Monsignor) on Jun 25, 2010 at 10:58 UTC |