|
|
| Don't ask to ask, just ask | |
| PerlMonks |
Re: 'do' read fileby scorpio17 (Prior) |
| on Dec 14, 2011 at 15:10 UTC ( #943565=note: print w/ replies, xml ) | Need Help?? |
|
In general, I think it's considered "bad practice" to put executable code into a config file. Try doing something like this instead:
And change your config file ("1.spec") to something like this:
When you run this code, you should get this output:
In other words, $config is a hash ref pointing to the data read from the config file. Config::Auto is very powerful, and can handle much more complicated situations. Read more about it on CPAN.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||