CPAN::API::HOWTO - a recipe book for programming with CPAN.pm
| Use Case | Command | Description |
|---|---|---|
| 🔍 Find distribution for a module | my $dist = CPAN::Shell->expand("Module","Data::UUID")->distribution()->pretty_id(); | Returns a string like "AUTHORID/TARBALL" |
| 📦 List modules in a distribution | CPAN::Index->reload(); | Returns list of module names |
All of these recipes assume that you have put use CPAN at the top of your program.
my $distribution = CPAN::Shell->expand(
"Module", "Data::UUID"
)->distribution()->pretty_id();
This returns a string of the form "AUTHORID/TARBALL". If you want the full path and filename to this distribution on a CPAN mirror, then it is .../authors/id/A/AU/AUTHORID/TARBALL.
CPAN::Index->reload();
my @modules = CPAN::Shell->expand(
"Distribution", "JHI/Graph-0.83.tar.gz"
)->containsmods();
You may also refer to a distribution in the form A/AU/AUTHORID/TARBALL.
the main CPAN.pm documentation
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See <http://www.perl.com/perl/misc/Artistic.html>
David Cantrell
Generated by phpman v4.9.22-1-g1b0fcb4 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-05 06:44 @216.73.216.52
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Enhanced by LLM: deepseek-v4-pro / taotoken.net / www.chedong.com - original format