Frage

I have a mod_perl system accepting API calls from different client systems Suppose in the child perl program I have calls like this which does some heavy processing

$conf{$client_id} = generate_client_conf($client_id); # returns a ref to a hash

I would like to re-use this variable $conf{$client_id} in other child processes How can I do this ?

The variables cannot be loaded at startup.pl ,but needs to be cached once it is generated

War es hilfreich?

Lösung

You should use Cache::FastMmap

In mod_perl, just open the cache at the global level in the appropriate module, which is executed as the server is starting and before it starts forking children, but you'll probably want to chmod or chown the file to the permissions of the apache process.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top