Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: Refactoring conf-driven app into a module; what to do with the config?

by moritz (Cardinal)
on Sep 18, 2012 at 04:26 UTC ( #994176=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Refactoring conf-driven app into a module; what to do with the config?
in thread Refactoring conf-driven app into a module; what to do with the config?

In your case I'd probably just hardcode a path, like /usr/share/yourmodule/ and put the data file(s) there. Unless they are pretty small, in which case a __DATA__ section would be even easier. Then change your module to read them when it needs them.

That's the "how" if you don't follow the File::ShareDir route -- though personally I think that even simples modules should have a proper build/install system (via Module::Install or Module::Build), because it's easy to set up and easy to use.

Occasionally certain values will need to be changed, but this would be on an application-wide basis, not on a user-by-user basis.

This indicates that it's not a one-off script, but something that is developed and/or maintained over a longer period of time. I'd definitively go the Module::Install/Module::Build route for that, and use File::ShareDir to locate the data files. But your mileage my vary, of course.


Comment on Re^3: Refactoring conf-driven app into a module; what to do with the config?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (16)
As of 2015-07-02 10:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (33 votes), past polls