in reply to Re: large perl module
in thread large perl module

Any hints on doing this (shared 'module')?
Right now mod_perl script looks like this:
use GiantModule(); use CGI; .... my $carrier = GiantModule::lookup($phone_number); .... exit 0; ###################### That's how the .pm looks like: module GiantModule; my %carrier = ( .... GIANT HASH .... ); sub lookup { my $phone=shift; ..... return $carrier{.....}; }

Replies are listed 'Best First'.
Re^3: large perl module
by almut (Canon) on Mar 04, 2010 at 22:32 UTC
      most of the discussion still applies
      But only in a very general sense.

      Better look at the version 2.2 docs and more specifically the comments on the Postconfig Handler. But even if you load the module that early in the server startup-cycle, there is no guarantee that the data will stay shared for the lifetime of the server.

      CountZero

      A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

        But even if you load the module that early in the server startup-cycle, there is no guarantee that the data will stay shared for the lifetime of the server.

        Exactly what I tried to point out in my initial reply.