Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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

by afoken (Canon)
on Aug 07, 2015 at 18:05 UTC ( #1137870=note: print w/replies, xml ) Need Help??


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". ;-)
  • Comment on Re: What's the right way to include a config file as a .pm bareword?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1137870]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2020-08-05 11:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which rocket would you take to Mars?










    Results (35 votes). Check out past polls.

    Notices?