CPAN::API::HOWTO(3perl)

🌸 NAME 🌸

okay so CPAN::API::HOWTO β€” it's literally a recipe book πŸ“– for programming with CPAN.pm. like, a lil cookbook for when you wanna vibe with CPAN from inside your own Perl code. bestie, it's giving tutorial energy ✨


πŸŽ€ RECIPES πŸŽ€

every single one of these recipes just assumes you already dropped

use CPAN

at the top of your program. no cap, that's the prerequisite. do that first or nothing below works πŸ’…

πŸ’– What distribution contains a particular module?

my $distribution = CPAN::Shell->expand(
    "Module", "Data::UUID"
)->distribution()->pretty_id();

this hands you back a string shaped exactly like "AUTHORID/TARBALL". cute, right? 🫢

and if you're the kind of person who needs the full path and filename to that distribution over on a CPAN mirror, then it's:

".../authors/id/A/AU/AUTHORID/TARBALL"

lowkey iconic file layout, iykyk

πŸ¦‹ What modules does a particular distribution contain?

CPAN::Index->reload();
my @modules = CPAN::Shell->expand(
    "Distribution", "JHI/Graph-0.83.tar.gz"
)->containsmods();

you can also refer to a distribution in the form A/AU/AUTHORID/TARBALL if that's more your vibe 🌈


πŸ‘‘ SEE ALSO πŸ‘‘

the main CPAN.pm documentation β€” go read it, it's the source of truth fr fr πŸ’œ


πŸ’… LICENSE πŸ’…

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>


⭐ AUTHOR ⭐

David Cantrell


and that's the whole page, bestie 🧚 this was CPAN::API::HOWTO(3perl) from perl v5.44.0, dated 2026-10-17. stay slay, stay documented πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from
  • arch rolling: perl 5.44.0-1 Β· Artistic-1.0-Perl AND GPL-1.0-or-later
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms