On 24.10.2008 15:03 Michael Peters wrote:

> This is only true if those structures were created during run time and go out 
> of scope at run time. 
> If they are generated at compile time or attached to global variables or 
> package level variables, 
> they will not be re-used by Perl.

Wait a minute, I would like to do exactly that: use a config module in
startup.pl that loads some massive config hashes in the hope that the
memory they use will be shared:

package MyConfig;
our $aHugeConfigHash = load_data_from_config_file();

then in my mod_perl module:
my $conf = $MyConfig::aHugeConfigHash;

(well sort of, it is actually wrapped in an accessor but that gets its
data from the package variable)

Are you saying, I cannot share the memory this way? And if so, is there
an alternative?

-Michael

Reply via email to