in reply to Odd Apache::Reload failure

What's the behavior you see when it doesn't work, i.e. how can you tell?

UPDATE:

I think I see the problem. Your code has to call Apache::Reload::import(), which normally happens when you use a module but not when you do it via Module::Load::Conditional::can_load(). Test this by replacing that line with a normal "use Apache::Reload".

Replies are listed 'Best First'.
Re^2: Odd Apache::Reload failure
by Phoenix Rising (Initiate) on Jun 05, 2008 at 20:39 UTC
    That looks like it'll do it! I didn't think of it because I'm not importing any methods from the package, but Apache::Reload uses import() to call register_module(). Well, testing explicit Reload now. If it works, I may just do away with the implicit Reloads. If not, then I'll be inserting a lot of import() calls into modules!
      This, by the way, is another example of why I think using import() for things other than importing is a bad idea. If the docs had said you must call Apache::Reload::register_module() instead of doing it for you magically when you use Apache::Reload, you wouldn't have wondered why it wasn't working.

        Good point. Have you deleted strict.pm yet?

        Perhaps Module::Lo­ad::Condit­ional should use a test like autouse does to verify whether or not import() is "special". (autouse throws up if you try to use it on a module whose import() didn't come from Exporter).

        Note that I need to file a bug against autouse because it doesn't notice that it can still break things even when Exporter::import() is used because it doesn't deal with export_fail().

        - tye