in reply to Reading .cfg file
I find that sample code awful. Please dig around in the CPAN for some more reasonable, and safer, alternatives: starting with a plain search on config.