use LWP::Simple qw(get); BEGIN { push @INC, sub { shift; my $file = shift; # eg "Foo/Bar.pm" my $content = get("http://myrepository.com/modules/$file"); if ($content) { open(my $fh, "<", \$content); return $fh; } else { return; } } }