John Reid ([EMAIL PROTECTED]) said something to this effect:
> Hi Guys

*snip*

> server start. I experimented with IPC::Shareable, but when I attempted
> to do anything with it in my startup.pl file it segfaulted the server
> and httpd would not start.

Hi John,

If IPC::Sharable is failing for you, possibly Apache::Session can be
used to share global data (it can be shared read only and read-write
this way). Apache::Session works by tying a hash to an underlying
data structure, and, as of 1.51, is very easy to extend.

>From perldoc Apache::Session:

    Sharing data between Apache processes

       When you share data between Apache processes, you need to
       decide on a session ID number ahead of time and make sure
       that an object with that ID number is in your object store
       before starting you Apache.  How you accomplish that is
       your own business.  I use the session ID "1".  Here is a
       short program in which we use Apache::Session to store out
       database access information.

        use Apache;
        use Apache::Session::File;
        use DBI;

        use strict;

        my %global_data;

        eval {
            tie %global_data, 'Apache::Session::File', 1,
               {Directory => '/tmp/sessiondata'};
        };
        if ($@) {
           die "Global data is not accessible: $@";
        }

        my $dbh = DBI->connect($global_data{datasource},
           $global_data{username}, $global_data{password})
          || die $DBI::errstr;

        undef %global_data;

        #program continues...

       As shown in this example, you should undef or untie your
       session hash as soon as you are done with it.  This will
       free up any locks associated with your process.

Hope this helps...

(darren)

-- 
One man's "magic" is another man's engineering.  "Supernatural" is a null word.
    -- Robert Heinlein

Reply via email to