SPUG: Using import() as init under mod_perl

Andrew Sweger andy at n2h2.com
Fri Aug 6 09:48:26 CDT 1999


Let's say you've got a Perl module (Module.pm) that you've loaded via the
PerlRequire Apache directive (a la mod_perl) and you're planning on
'use'ing it in a Perl script serviced under Apache::Registry. Can anyone
comment on any possible problems with using Module::import() as an
initialization routine to reset global variables?

Example: in Module.pm

package Module;

sub import {
	$Module::tabulator = 0;
}

As I understand it, Module->import ("class" method) will be called each
time the module is 'use'd. Make sense?

-- 
 Andrew Sweger <andy at n2h2.com>    N2H2, Creators of Bess and SearchOpolis
                                  900 Fourth Avenue, Suite 3400
 No thanks, I'll just have the    Seattle WA 98164-1059
     Linux with a side of Perl    http://www.n2h2.com/  (206) 336-2947




 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    POST TO: spug-list at pm.org        PROBLEMS: owner-spug-list at pm.org
 Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
 SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe
        Email to majordomo at pm.org: ACTION spug-list your_address





More information about the spug-list mailing list