Octavian Rasnita wrote:
> Hi,
> 
> I have a config file which contains a hash ref and I get its values by using
> the do() function.
> 
> I don't think this is the best solution, because the speed might be slow.
> That file is accessed on each access to each page.
> 
> Is it possible to store that hash in the memory somehow?

Just put it into it's own package and preload it. As long as you don't
change the data it'll stay shared.

package MyConfig;

our %DATA = (
...
);

1;

Then reference it anywhere as MyConfig::DATA{foo};

HTH
-- 
Michael Peters
Developer
Plus Three, LP

Reply via email to