perl5ever has asked for the wisdom of the Perl Monks concerning the following question:
1. unshifts a sub ref/object to @INC which when use X is encountered will install an AUTOLOAD stub for package X.
2. The AUTOLOAD stub will 1) remove itself from package X and 2) perform a do on the real path of the module and 3) goto &$AUTOLOAD.
The main purpose would be to avoid loading/compiling a module until when one of its subroutines was actually called. It wouldn't work for all modules (such as meta-programming modules or ones that exported symbols), but it could work for fairly "conventional" modules.
Does anything like that currently exist?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: lazy loading of modules
by Corion (Patriarch) on Jan 31, 2010 at 21:37 UTC | |
|
Re: lazy loading of modules
by shmem (Chancellor) on Jan 31, 2010 at 23:04 UTC | |
|
Re: lazy loading of modules
by Khen1950fx (Canon) on Jan 31, 2010 at 22:11 UTC |