I got the following from "Writing Apache Modules with Perl and C" by
Lincoln Stein & Doug MacEachern
From Chapter 5 Maintaining State:
It uses IPC::Shareable and requires Storable
It ties Perl data structures (scalars and hashes, but not arrays.)
the idiom:
tie %H, 'IPC::Shareable', 'Test', {create => 1, mode => 0666};
on success it will tie %H to the shared memory segment.
You should be able to get the data from all of your child processes
once it's tied.
The book suggests using tied(%hash)->shlock and tied(%hash)->shunlock
to lock the variable before updating and unlocking afterwards to prevent
multiple processes from updating at the same time.
Hope that helps...
Boysenberry
boysenberrys.com | habitatlife.com | selfgnosis.com
On Sep 7, 2005, at 10:39 AM, Anthony Gardner wrote:
Hola,
We're using apache/1.3.33 and mod_perl/1.29.
the problem is, a personal ENV variable is set in my
environment and read from a script like .....
my $ENVNAME = $ENV{MY_PERSONAL_ENV} || 'STHELSE';
When the server is started a fresh, I can display my
ENV on my webpage but when I press refresh, it
disappears ...... never to be seen again.
The contents of the ENV var is used to find a file and
require it. So .....
require "General/Config_$ENVNAME" ;
What else do you need to know? Well, the script that
contains this code is not loaded at server start up
(not in startup.pl) for instance. Sometimes it works,
sometimes it doesn't (that old cliche).
I could try work arounds but b4 I do, I'd like to
understand what may be going on here.
any pointers would be great.
CIA
-Ants
___________________________________________________________
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with
voicemail http://uk.messenger.yahoo.com