One way to to this would be (assuming that we haven't been told explicitly how to load the asked-for module) to examine (caller(1))[3], strip the part following the last :: and see if the resulting package name is one that this module caused to be loaded over the network. If so, try to guess the pathname following the standard rules. Remember that you can touch the appropriate entry in the %INC hash to record little details about what was loaded over the network.
Also, I am troubled by your invoking another perl interpreter. Among other things, I'd use $^X instead of "perl" - I occasionally work on machines where "perl" invokes perl 5.005, but "/qhds/bin/perl" invokes perl 5.6.1. However, it's possible to avoid a second perl interpreter - just do:
With sufficiently high versions of perl, you can even open a scalar for reading directly, exactly as you'd open a file, but for this usage the IO::Scalar code is simpler.use LWP::Simple; use IO::Scalar; my $modulecontent = get($urls{$filename}); if (!defined($modulecontent)) {return undef;} else {return new IO::Scalar \$modulecontent;}
In reply to Re: Using Remote Modules over HTTP
by fizbin
in thread Using Remote Modules over HTTP
by jdrago_999
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |