http://qs321.pair.com?node_id=1137870


in reply to What's the right way to include a config file as a .pm bareword?

Why using unlimited executable code in a config file is a bad idea: Re^2: conf file in Perl syntax.

Use a non-executable configuration, as 1nickt++ explained. If you don't like Config::Tiny, or if INI files are too simple for your configuration, consider using JSON (e.g. using JSON::XS), XML (with the help of e.g. XML::LibXML), or YAML.

All of these formats contain no executable code.

Update (2015-08-09): YAML can contain executable code. Depending on how you configure the YAML reader, parts of the configuration file may be executed. So don't use YAML until you know how to prevent the YAML reader from executing code from the YAML file.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)