MetaCPAN::Helper - a MetaCPAN client that provides some high-level helper functions
use MetaCPAN::Helper; my $helper = MetaCPAN::Helper->new(); my $module = 'MetaCPAN::Client'; my $distname = $helper->module2dist($module); print "$module is in dist '$distname'\n";
This module is a helper class built on top of MetaCPAN::Client, providing methods which provide simple high-level functions for answering common "CPAN lookup questions".
Note: this is an early release, and the interface is likely to change. Feedback on the interface is very welcome.
You could just use MetaCPAN::Client directly yourself, which might make sense in a larger application. This class is aimed at people writing smaller one-off scripts.
Takes the name of a module or a MetaCPAN::Client::Module object, and returns the name of the distribution which currently contains that module, according to the MetaCPAN API.
At the moment this will ignore any developer releases, and take the latest non-developer release of the module.
If the distribution name in the dist's metadata doesn't match the name produced by CPAN::DistnameInfo, then be aware that this method returns the name according to CPAN::DistnameInfo. This doesn't happen very often (less than 0.5% of CPAN distributions).
CPAN::DistnameInfo
Takes the name of a distribution or a MetaCPAN::Client::Distribution object, and returns the MetaCPAN::Client::ResultSet iterator of all releases (as MetaCPAN::Client::Release objects) associated with that distribution.
Takes the name of a distribution or a MetaCPAN::Client::Distribution object, and returns the MetaCPAN::Client::Release object of the "latest" release of that distribution.
MetaCPAN::Client - the definitive client for querying MetaCPAN.
https://github.com/CPAN-API/metacpan-helper
Neil Bowers
Mickey Nasriachi
This software is copyright (c) 2015 the MetaCPAN project.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install MetaCPAN::Helper, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MetaCPAN::Helper
CPAN shell
perl -MCPAN -e shell install MetaCPAN::Helper
For more information on module installation, please visit the detailed CPAN module installation guide.