in reply to Loading PERL Module from scalar in RAM?
The callback can decide to return the code if encountered by require while working thru @INC.
The interface is a bit convoluted but it works. After adding the hook inside BEGIN you can call use or require deeply hidden inside foreign code and your "RAM modules" are installed.
You can also insert hooks into the file inclusion system by putting Perl code directly into @INC. Those hooks may be subroutine references, array references or blessed objects. See "require" in perlfunc for details.
here some example code from an older discussion
in that case the code is fetched via HTTP, but it should be easy to to just fill in your RAM stuff instead.
Cheers Rolf
(addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
Wikisyntax for the Monastery
|
---|