CPAN::R...:Dynamic(3)
๐ธ CPAN::Requirements::Dynamic ๐ธ
okay bestie, welcome to the manual page for CPAN::Requirements::Dynamic โ which the header line shows as CPAN::R...:Dynamic(3) because it got truncated, and honestly the ellipsis is serving main character energy ๐
. Anyway. This is the page for dynamic prerequisites in meta files, and it's genuinely so fun once you get it. Let's go ๐ซถ
โญ VERSION โญ
version 0.003 โ tiny number, big vibes โจ
๐ฆ SYNOPSIS ๐ฆ
here's the whole mood, verbatim, no cap:
my $result = $dynamic->evaluate({
expressions => [
{
condition => [ 'has_perl' => 'v5.20.0' ],
prereqs => { Bar => "1.3" },
},
{
condition => [ is_os => 'linux' ],
prereqs => { Baz => "1.4" },
},
{
condition => [ config_defined => 'usethreads' ],
prereqs => { Quz => "1.5" },
},
{
condition => [ and =>
[ config_defined => 'usethreads' ],
[ is_os => 'openbsd' ],
],
prereqs => { Euz => "1.7" },
},
{
condition => [ not => is_os_type => 'Unix'],
error => 'OS unsupported',
},
],
});
look at her go ๐ญ๐
๐ DESCRIPTION ๐
So this module implements a format for describing dynamic prerequisites of a distribution. That's it, that's the whole description. It's giving "confident and concise" and we respect it ๐๐ฅ
๐ METHODS ๐
๐ new(%options)
The constructor! It takes two named arguments, both optional but like... highly recommended, bestie, please use them ๐ฅบ
configโ anExtUtils::Config(compatible) object for reading configuration. it's giving "power source" ๐pureperl_onlyโ this should be the value of the"pureperl-only"flag. yes, exact string, keep the quotes in your head ๐
๐ evaluate(%options)
This one takes a hash with two named arguments: "version" and "expressions" โจ
versionis the version of the format, and it currently defaults to1(humble queen ๐)expressionsis a list of hashes, and each hash can contain the following keys:
๐ the keys ๐
conditionโ the condition of the dynamic requirement. it's an array with a name as first value(s) and zero or more arguments following it. the semantics live below under"Conditions"๐prereqsโ a hash with modules for keys and the required version as values (e.g.{ Foo => '1.234' }). love a key-value moment ๐ซphaseโ the phase of the requirements. defaults to'runtime'. other valid values include'build'and'test'๐งrelationโ the relation of the requirements. defaults to'requires', but other valid values include'recommends','suggests'and'conflicts'โ๏ธerrorโ it will die with this error if set. the two messages"No support for OS"and"OS unsupported"have special meaning to CPAN Testers and are generally encouraged for situations that indicate not a failed build but an impossibility to build. so like, use them with intention, iykyk ๐
ngl this is the important bit:"condition"and one of"prereqs"or"error"are mandatory. not optional, not "maybe later", mandatory periodt ๐
๐ evaluate_file($filename)
takes a filename โ and it can be either a YAML file or a JSON file โ and evaluates it. two formats, one method, slay ๐ฆ
๐ Conditions
this is the whole condition catalogue, bestie, buckle up ๐ข
can_run($command)โ returns true if a$commandcan be run ๐config_defined($variable)โ returns true if a specific configuration variable is defined ๐ฏhas_env($variable)โ returns true if the environmental variable with the name in$variableis true ๐ฑhas_perl($version)โ returns true if the perl version satisfies$version. and$versionis interpreted exactly as in theCPAN::Metaspec (e.g.1.2equals'>= 1.2') ๐ฎ no improvising!is_extendedโ returns true if extended testing is asked for ๐งชis_os(@systems)โ returns true if the OS name equals any of@systems๐ฅ๏ธis_os_type($type)โ returns true if the OS type equals$type. typical values of$typeare'Unix'or'Windows'๐ชis_smokerโ returns true when running on a smoker ๐จ (yes, that's really what it's called, iconic)has_envโ this returns true if the given environmental variable is true. (yep, this one appears a second time in this list โ the page said it twice and I'm not about to erase her truth ๐ ๐ซถ)want_xsโ returns true if a compiler appears to be available, and the"pureperl_only"option has not been set โ๏ธnotโ takes an expression and negates its value ๐orโ takes a list of arrayrefs, each containing a condition expression. if at least one of the conditions is true, this will also return true ๐andโ takes a list of arrayrefs, each containing a condition expression. if all of the conditions are true, this will also return true ๐ฏ
๐ AUTHOR ๐
Leon Timmermans <fawaka@gmail.com> โ thank you legend ๐
๐ COPYRIGHT AND LICENSE ๐
This software is copyright (c) 2023 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. free software fr fr ๐๐
okay and the cutest little sign-off for you: this page is from perl v5.42.2, dated 2026-07-12, and it lives under the name CPAN::R...:Dynamic(3) (truncated again, she's consistent โจ). that's the whole thing bestie, you ate this, go write some dynamic prereqs ๐๐ฆ๐
๐ฆ where this page comes from
- arch rolling: perl-cpan-requirements-dynamic 0.003-1 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms