package RemoteModule; =item Copyright 2004 John Drago This software is free software and may be distributed under the same terms as perl itself, so long as this copyright notice is included. Dependancies: LWP::UserAgent HTTP::Request::Common Synopsis: use RemoteModule "Crypt::RC4" => "http://search.cpan.org/src/SIFUKURT/Crypt-RC4-2.02/RC4.pm"; use Crypt::RC4; my $crypted = RC4("secret password!!!", "Text to be encrypted!"); print "Encrypted: $crypted\n"; print "Decrypted: " . RC4( "secret password!!!", $crypted ); =cut use strict; my %urls = (); #======================================================== # #======================================================== sub import { my ($s) = shift; my ($class,$url) = @_; $urls{$class} = $url; }# end BEGIN{} #======================================================== # #======================================================== BEGIN { push @INC, sub { my ( $coderef, $filename ) = @_; $filename =~ s/\//::/g; $filename =~ s/\.pm$//; return undef unless defined $urls{$filename}; open my $fh, "perl " . " -MHTTP::Request::Common " . " -MLWP::UserAgent " . " -e \"print LWP::UserAgent->new->request( " . " GET '$urls{$filename}' " . " )->content\" | "; return $fh; }; }# end BEGIN 1;