Cody Fendant has asked for the wisdom of the Perl Monks concerning the following question:
I'm looking at Perl::Critic and it's complaining about my use of a simple config.pl file.
I have code which needs to be told certain file paths and URLs, and I store those in a simple hash in a .pl file which looks like this:
$config = { foo => 'bar', baz => 'bax' }
and I require it it as follows:
our ($config); require '/path/to/config.pl';
Then I can just use $config->{foo} in my script.
So what's the simplest version of that which will satisfy Perl::Critic? It wants me to use something like My::Module::Config, but that's overkill for my purposes really. I don't need to create a module.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: What's the right way to include a config file as a .pm bareword?
by Corion (Patriarch) on Aug 07, 2015 at 07:37 UTC | |
Re: What's the right way to include a config file as a .pm bareword?
by Anonymous Monk on Aug 07, 2015 at 10:28 UTC | |
Re: What's the right way to include a config file as a .pm bareword?
by 1nickt (Canon) on Aug 07, 2015 at 11:29 UTC | |
Re: What's the right way to include a config file as a .pm bareword?
by Monk::Thomas (Friar) on Aug 07, 2015 at 09:57 UTC | |
Re: What's the right way to include a config file as a .pm bareword?
by vinoth.ree (Monsignor) on Aug 07, 2015 at 08:03 UTC | |
Re: What's the right way to include a config file as a .pm bareword?
by afoken (Chancellor) on Aug 07, 2015 at 18:05 UTC | |
Re: What's the right way to include a config file as a .pm bareword to satisfy a Perl::Critic rule ? ( Module::Load::load() )
by Anonymous Monk on Aug 07, 2015 at 08:47 UTC |