in reply to Encapsulate function and variables

Am I right in saying that you are wanting to specify static variables (as in configuration data) as Perl code, but contained in a number of different files?

You can use Config::Loader Config::Merge with your data contained in different files, in a directory tree. Config::Loader Config::Merge will do the work of loading them into a hash.

Or are you wanting to be able to access the same data via a hash deref or via a function call, in which case you want to use overload.

Clint

Update: Changed the module name to its new name

Replies are listed 'Best First'.
Re^2: Encapsulate function and variables
by nictam (Initiate) on Jun 20, 2007 at 12:14 UTC
    Clint, thanks.
    what I want to do is in fact almost what you describe. I have a set of configuration files that define the same variables, and I need to be able to load and access all of them.
    I will investigate the use of Config::Loader.
    cheers, nictam