IlyaM has asked for the wisdom of the Perl Monks concerning the following question:
It is possible to put reference on subroutine in @INC and this subroutine will be called when Perl module is used (or required). This subroutine could implement loading of Perl modules from ZIP archive for example. Unfortunately I could not find description what interface should have such subroutine. That is what arguments are passed to it, what should this subroutine return, etc.
To prove that I'm not dreaming I wrote simple test script:
It does print something which proves that subroutine reference in @INC does have some special meaning:BEGIN { unshift @INC, sub { print "@_\n"; return }; } use Cwd;
Does anybody have more info about it?CODE(0x8116490) Cwd.pm CODE(0x8116490) strict.pm CODE(0x8116490) Carp.pm CODE(0x8116490) Exporter.pm CODE(0x8116490) base.pm CODE(0x8116490) warnings.pm
--
Ilya Martynov
(http://martynov.org/)
|
---|
Replies are listed 'Best First'. | |
---|---|
(Ovid) Re: Subroutine reference in @INC
by Ovid (Cardinal) on Mar 21, 2002 at 22:12 UTC | |
Re: Subroutine reference in @INC
by Dominus (Parson) on Mar 21, 2002 at 22:31 UTC | |
Re: Subroutine reference in @INC
by gellyfish (Monsignor) on Mar 21, 2002 at 21:52 UTC | |
by IlyaM (Parson) on Mar 21, 2002 at 22:23 UTC | |
Re: Subroutine reference in @INC
by lestrrat (Deacon) on Mar 21, 2002 at 22:13 UTC | |
by broquaint (Abbot) on Mar 22, 2002 at 10:16 UTC |