A few comments/suggestions:
As someone else noted, this doesn't handle dependencies that occur in loading modules, and it would be nice if (e.g.) modules that Cram::MD4 depended on were loaded over the network, if necessary.

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:

use LWP::Simple; use IO::Scalar; my $modulecontent = get($urls{$filename}); if (!defined($modulecontent)) {return undef;} else {return new IO::Scalar \$modulecontent;}
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.

In reply to Re: Using Remote Modules over HTTP by fizbin
in thread Using Remote Modules over HTTP by jdrago_999

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.