in reply to Referencing subroutine in not-yet-loaded module

The alternatives are .. is this good practice or is it a bug? That's confusing to me. You said it works .. but you are filing a bug report? That's even more confusing.

Referencing a not yet loaded module in order to trigger loading on demand might be a great practice for saving on load time and memory requirements, but I would make sure this is well documented in your code.

Dum Spiro Spero
  • Comment on Re: Referencing subroutine in not-yet-loaded module

Replies are listed 'Best First'.
Re^2: Referencing subroutine in not-yet-loaded module
by vsespb (Chaplain) on Nov 05, 2015 at 14:48 UTC
    You said it works .. but you are filing a bug report?
    What works is references to subroutine in not-loaded packages. Bug report against Class::Load, which refuses to load packages after such referencing (thanks that I still have "require" working).
    is this good practice or is it a bug?
    Exactly. I think those are more probable alternatives.
    Referencing a not yet loaded module in order to trigger loading on demand might be a great practice for saving on load time and memory requirements
    I am not asking about such references in general, only about \&NotYetLoadedModule::mysub(); vs sub { &NotYetLoadedModule::mysub };