John ORourke wrote:
Question is, do anonymous subs assigned to hash values and placed in the 'new' method get compiled every time a new object is created or just when the module file is initially loaded?
#### if using anon subs, define them here: $$code{type1} = sub { do something cool; } $$code{type2} = sub { do something cooler; } $$code{type3} = sub { do something even cooler; }
The answer: it depends on whether you create a closure or not. In the case of anon-sub which acts as a closure it'll recompile each time it's encountered. Otherwise it'll be compiled once during the module loading. It's explained here:
http://perl.apache.org/docs/general/perl_reference/perl_reference.html#Understanding_Closures____the_Easy_Way
You absolutely must not create closures when running mod_perl.: http://perl.apache.org/docs/general/perl_reference/perl_reference.html#my___Scoped_Variable_in_Nested_Subroutines
-- __________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com