dcotter has asked for the wisdom of the Perl Monks concerning the following question:

Let me apologize in advance if this question has already been asked; it seems fairly basic, but I haven't been able to answer it for myself yet.

I'm writing a program that reads user profiles from a database and checks them against model profiles (stored in hashes) to see whether they were built correctly. Since the models are 20-30 lines each and there are about 40 of them, I was hoping to store them outside of the actual script that does the checking and import them at run-time, in order to keep things neat. What would be the best way to do this?

Thanks
  • Comment on Including variable definitions from an extraneous file

Replies are listed 'Best First'.
Re: Including variable definitions from an extraneous file
by kyle (Abbot) on Oct 02, 2007 at 17:14 UTC
Re: Including variable definitions from an extraneous file
by dwm042 (Priest) on Oct 02, 2007 at 17:34 UTC
    *Best* is extremely subjective. For something that is mostly key value pairs, a module like Config::Simple would appear to be enough.

Re: Including variable definitions from an extraneous file
by perlfan (Parson) on Oct 02, 2007 at 20:07 UTC
    If you need data persistence for complex data types, check out the Storable module.