LWP::Protocol::virtual - Protocol to locate resources on groups of sites
Version 0.02
# ## From shell, not perl. cpan URI::virtual echo 'CPAN http://cpan.mirror.com/pub/CPAN' > ~/.lwp_virt GET virtual://CPAN/some/path/some-path-1.0.tgz > some-path-1.0.tgz perl -MCPAN -e ' my $CPAN = CPAN->new(); CPAN::Config->load($CPAN); $CPAN::Config->{urllist} = [ qw(virtual://CPAN/) ]; CPAN::Config->commit("MyConfig.pm"); ' ## Move MyConfig to somewhere CPAN will find it.
This processes a request, by calling $uri->resolve on the URI object (which one would suspect is an instalnce of URI::virtual, and therefore supports it) and returning a redirect to the uri returned. Any URI subclass which satisfies the conditions:
$uri->can("resolve")->()->isa("URI") ref $uri->can("path") eq 'CODE'
will be acceptable. How you would tell LWP to use this Protocol for another scheme is anybody's guess.
see URI::virtual.
Rich Paul, <cpan@rich-paul.net> Mail to this address bounces, but you'll think of something. It's a poor man's Turing Test.
<cpan@rich-paul.net>
Please report any bugs or feature requests to bug-lwp-protocol-virtual@rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=LWP-Protocol-virtual. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-lwp-protocol-virtual@rt.cpan.org
The guys who wrote LWP. Nice job!
Copyright 2005 Rich Paul, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install LWP::Protocol::virtual, copy and paste the appropriate command in to your terminal.
cpanm
cpanm LWP::Protocol::virtual
CPAN shell
perl -MCPAN -e shell install LWP::Protocol::virtual
For more information on module installation, please visit the detailed CPAN module installation guide.