App::cpanurl - Get distribution URL from module name and version
This module is alpha release. Features will be changed without warnings.
(2013/3/20)
Sorry. This module is DEPRECATED because cpanm and cpanfile is much better.
If you want to install moudles, use cpanm and cpanfile instead.
See https://github.com/kraih/mojo/wiki/Installation-of-cpan-modules-by-cpanm-and-cpanfile
This module will be removed from CPAN on 2014/3/1
# http://cpan.metacpan.org/authors/id/S/SR/SRI/Mojolicious-3.82.tar.gz cpanurl Mojolicious 3.82 # http://cpan.metacpan.org/authors/id/G/GA/GAAS/libwww-perl-6.04.tar.gz cpanurl LWP 6.04 cpanurl libwww-perl-6.04 # http://cpan.metacpan.org/authors/id/S/SR/SRI/Mojolicious-3.82.tar.gz # http://cpan.metacpan.org/authors/id/K/KI/KIMOTO/DBIx-Custom-0.23.tar.gz cpanurl -f module.txt # module.txt Mojolicious 3.82 DBIx::Custom 0.23
You can get module URL.
# http://cpan.metacpan.org/authors/id/S/SR/SRI/Mojolicious-3.82.tar.gz cpanurl Mojolicious 3.82
If you want to get many module urls, you can use -f option and module file.
-f
cpanurl -f module.txt
Module file is the following format.
Mojolicious 3.82 DBIx::Custom 0.23
You can get the following output
http://cpan.metacpan.org/authors/id/S/SR/SRI/Mojolicious-3.82.tar.gz http://cpan.metacpan.org/authors/id/K/KI/KIMOTO/DBIx-Custom-0.23.tar.gz
Use cpanm with cpanurl to install modules.
cpanurl
cpanurl Mojolicious 3.82 | cpanm
If you want to install many modules, you can create module file.
# module.txt Mojolicious 3.82 DBIx::Custom 0.23
And use -f option to read this file.
cpanurl -f module.txt | cpanm
Some module name is different from disttribution name. cpanurl is automatically resolve this relation.
# Module name Distribution name LWP libwww-perl IO::Compress::Base IO-Compress Cwd PathTools File::Spec PathTools List::Util Scalar-List-Utils Scalar::Util Scalar-List-Utils Template Template-Toolkit
If you want to use distribution name, pass one argument.
cpanurl libwww-perl-6.04
You can use Module name or distribution name.
# both OK cpanurl LWP 6.04 cpanurl libwww-perl-6.04 # both OK cpanurl Cwd 3.40 cpanurl PathTools-3.40
cpanurl http://somehost.com/Foo-0.01.tar.gz cpanurl https://somehost.com/Foo-0.01.tar.gz
If URL which start http:// or https:// is passed to argument, That URL is passed through to output.
http://
https://
# Output http://somehost.com/Foo-0.01.tar.gz https://somehost.com/Foo-0.01.tar.gz
cpanurl use two HTTP client as necessary.
These module is used to get module URLs from metaCPAN.
If LWP::UserAgent 5.802+ is installed, LWP::UserAgent is seleced. If not, HTTP::Tiny is selected.
--lwp option force LWP::UserAgent.
--lwp
cpanurl --lwp Mojolicious 3.82
--no-lwp option force HTTP::Tiny.
--no-lwp
cpanurl --no-lwp Mojolicious 3.82
export http_proxy=http://hostname:3001
http_proxy environment variable enable you to use proxy server.
http_proxy
export http_proxy=http://username:password@hostname:3001
If LWP::UserAgent 5.802+ is installed, proxy authentication is available. HTTP::Tiny don't support proxy authentication.
Copyright 2013 Yuki Kimoto.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install App::cpanurl, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::cpanurl
CPAN shell
perl -MCPAN -e shell install App::cpanurl
For more information on module installation, please visit the detailed CPAN module installation guide.