in reply to Dynamic variables and strict
This would tell you (and anyone who reads your code!) that values accessed using the hash came from outside the program. It also seems to clean up uninitialized varible issues... I don't know, it just seems right to use a hash to relate keys to values.#untested code! my %conf = (); foreach (`. /my/config.cfg; set`) { chomp; my ($var,$val) = /^\s*(.*?)\s*=\s*(.*)/; $conf{$var} = $val; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Dynamic variables and strict
by FunkyMonk (Bishop) on May 02, 2007 at 22:35 UTC |