in reply to Re^2: apache2::reload and base.pm
in thread apache2::reload and base.pm

Check the caveats http://search.cpan.org/~phred/Apache-Reload-0.10/lib/Apache2/Reload.pm#Problems_With_Reloading_Modules_Which_Do_Not_Declare_Their_Package_Name

Replies are listed 'Best First'.
Re^4: apache2::reload and base.pm (re-import)
by tye (Sage) on Feb 17, 2010 at 08:09 UTC

    The correct caveat for this case is actually a little further down under the "Problems with Scripts Running with Registry Handlers that Cache the Code" heading. In particular, "cached code won't run 'use My::Utils;' again". Similarly, "use base ..." doesn't get run again therefore base::import doesn't initialize @...::ISA again.

    A solution (as mentioned) is to not do such things at compile-time. Instead use, for example:

    require base; base->import( qw< ... > );

    Of course, not having such stuff initialized at compile-time might break code structured in unfortunate ways, so test it.

    - tye        

      Thanks tye, I actually have tried this and sadly still get the same error.
Re^4: apache2::reload and base.pm
by jshinb2g (Initiate) on Feb 17, 2010 at 06:02 UTC
    I've actually read that and tried to mess around with base.pm, but nothing will work... Can I just not use base and expect Apache2::Reload to ever work correctly ?
      um, the problem is most likely with your code. base has some problems that parent cures, but if that doesn't help your situation, then the problem is with your code.
        updated thread with bare-bones-version of my code. do you see a problem with it?