A recent node reminded me of a problem I had a while back - how to include some sort of periodically changing data into a module. These are some possibilities I came up with, though I'm sure there are others:
- Incorporate the data directly into the module as a data structure, and just update the module when the data changes.
- Same, but incorporate it in a __DATA__ section of the module.
- Inherit from a separate data module.
- Use a separate config data file (text, yaml etc) for the module in @INC. Provide class method to update it.
- Provide methods to import and update the data in a config file local to the calling program.
My solution was #1 just for expedience (though it didn't feel quite right), however, the data was from the PNG specification, which shouldn't be expected to change often. Other data such as a list of PPM repositories may be more of a moving target. Especially for a CPAN module, it would seem useful to provide a method to update the data rather waiting for the module author or hacking the module yourself.
I was wondering what others have done, and what might be considered better ways of handling data for modules such as PPM::Repositories, where it's likely that the user would want or need to update the module's data on their own.