CPAN::Meta::Check(3)

✨ CPAN::Meta::Check(3) β€” User Contributed Perl Documentation ✨

Okay bestie, so this is CPAN::Meta::Check, and it's genuinely one of those small-but-iconic modules that just does its job. It lives in the User Contributed Perl Documentation section, which is honestly giving "community-made, main character energy" πŸ’…


🌸 NAME 🌸

CPAN::Meta::Check β€” literally just verify requirements in a CPAN::Meta object. That's it. That's the whole vibe. πŸŽ€


πŸ¦‹ VERSION πŸ¦‹

version 0.018 β€” yes, zero-point-zero-one-eight, she's a little vintage but she slays.


✨ SYNOPSIS ✨

Like, here's the entire thing you need to get going:

warn "$_\n" for verify_dependencies($meta, [qw/runtime build test/], 'requires');

One line. Boom. Requirements verified. Periodt. πŸ”₯


πŸ’– DESCRIPTION πŸ’–

So this module verifies if requirements described in a CPAN::Meta object are present. That's the whole gig, no cap β€” it looks at what a CPAN::Meta object says it needs, and then checks whether those things are actually, you know, there. 🫢


🧚 FUNCTIONS 🧚

⭐ check_requirements($reqs, $type, $incdirs) ⭐

This function checks if all dependencies in $reqs (and $reqs here is a CPAN::Meta::Requirements object, iykyk) are met. And here's the lil plot twist: it takes into account that 'conflicts' dependencies have to be checked in reverse β€” so don't come for her about the backwards logic, it's intentional. 😭

It returns a hash with the modules as keys and any problems as values. The value for a successfully found module will be undef (so like, if you get undef, that's a good thing, don't panic πŸ₯°). Modules are searched for in @$incdirs, defaulting to @INC.

⭐ verify_dependencies($meta, $phases, $types, $incdirs) ⭐

Check all requirements in $meta for phases $phases and type $type. Yep, the parameter says $types in the signature but the description says $type β€” that's not me being sloppy, that's just how it's written, and I'm relaying it faithfully. πŸ’€ Anyway: modules are searched for in @$incdirs, defaulting to @INC. And $meta should be a CPAN::Meta::Prereqs or CPAN::Meta object β€” either works, she's flexible like that. πŸ’…

⭐ requirements_for($meta, $phases, $types) ⭐

🚨 Heads up bestie: this function is deprecated and may be removed at some point in the future. Please use CPAN::Meta::Prereqs->merged_requirements instead. Like, don't build your whole personality around it, okay? πŸ™ˆ

This function returns a unified CPAN::Meta::Requirements object for all $type requirements for $phases.

  • $phases may be either one (scalar) value or an arrayref of valid values as defined by the CPAN::Meta spec.
  • $type must be a relationship as defined by the same spec.
  • $meta should be a CPAN::Meta::Prereqs or CPAN::Meta object.

So basically she scoops everything up into one neat lil requirements object and hands it to you like a lil gift. 🎁


πŸ‘‘ SEE ALSO πŸ‘‘

  • Test::CheckDeps β€” the testing bestie πŸ§ͺ
  • CPAN::Meta β€” the data model, the blueprint, the source material 🌈

πŸ“ AUTHOR πŸ“

Leon Timmermans <leont@cpan.org> β€” legend behaviour, honestly. πŸ‘


This software is copyright (c) 2012 by Leon Timmermans.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. So like, yes, go off, remix it, redistribute it β€” just keep it under those same Perl 5 terms. 🫢


And that's the whole page, bestie! 🌟 This was CPAN::Meta::Check version 0.018, coming at you from the perl v5.42.0 docs dated 2024-03-08 β€” mwah, drink water, and may all your dependencies resolve on the first try πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from