Welcome to the Monastery | |
PerlMonks |
Re: Config::Tiny croaks at runtime, not in debuggerby haukex (Archbishop) |
on May 06, 2016 at 15:12 UTC ( [id://1162364]=note: print w/replies, xml ) | Need Help?? |
Hi xavier8854, Welcome! What is the exact error message, including the contents of $Config::Tiny::errstr? Also, I don't think chdir dirname($0); will be reliable in all environments, have a look at FindBin instead of trying to chdir (which may fail due to security/permission restrictions) or use $0 (which isn't always the name of the script file!). Even FindBin isn't always perfect but it tries fairly hard and has almost always worked for me.
Although you may want to consider the security implications of saving the config file alongside the script, and reporting the exact location of that file via the error message in case opening the file fails. Regards,
In Section
Seekers of Perl Wisdom
|
|