![]() |
|
XP is just a number | |
PerlMonks |
Re: Updating Hash from a config fileby toolic (Bishop) |
on Oct 12, 2007 at 13:36 UTC ( [id://644482]=note: print w/replies, xml ) | Need Help?? |
Regarding requests for suggestions to improve your code's
robustness...
My guess is that you are probably not using the strictures, since $config_file is not declared with my (at least, not in your sub):
When accessing an environment variable, it is a good practice to test if it is defined. If it is not defined, you could either die (as shown below), or assign it a default value:
Should <CFILE> really be <CONFFILE>? It is also a good practice to close a filehandle when you are done. These tips probably do not solve your specific problem, but hopefully they are small steps toward more robust code.
In Section
Seekers of Perl Wisdom
|
|