.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.48) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "CPAN::Requirements::Dynamic 3" .TH CPAN::Requirements::Dynamic 3 2026-10-26 "perl v5.44.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 10 \& my $result = $dynamic\->evaluate({ \& expressions => [ \& { \& condition => [ \*(Aqhas_perl\*(Aq => \*(Aqv5.20.0\*(Aq ], \& prereqs => { Bar => "1.3" }, \& }, \& { \& condition => [ is_os => \*(Aqlinux\*(Aq ], \& prereqs => { Baz => "1.4" }, \& }, \& { \& condition => [ config_defined => \*(Aqusethreads\*(Aq ], \& prereqs => { Quz => "1.5" }, \& }, \& { \& condition => [ and => \& [ config_defined => \*(Aqusethreads\*(Aq ], \& [ is_os => \*(Aqopenbsd\*(Aq ], \& ], \& prereqs => { Euz => "1.7" }, \& }, \& { \& condition => [ not => is_os_type => \*(AqUnix\*(Aq], \& error => \*(AqOS unsupported\*(Aq, \& }, \& ], \& }); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This module implements a format for describing dynamic prerequisites of a distribution. .PP This constructor takes two (optional but recommended) named arguments .IP \(bu 4 config .Sp This is an ExtUtils::Config (compatible) object for reading configuration. .IP \(bu 4 pureperl_only .Sp This should be the value of the \f(CW\*(C`pureperl\-only\*(C'\fR flag. .PP This takes a hash with two named arguments: \f(CW\*(C`version\*(C'\fR and \f(CW\*(C`expressions\*(C'\fR. The former is the version of the format, it currently defaults to 1. The latter is a list of hashes that can contain the following keys: .IP \(bu 4 condition .Sp The condition of the dynamic requirement. This is an array with a name as first values and zero or more arguments following it. The semantics are described below under "Conditions" .IP \(bu 4 prereqs .Sp The prereqs is a hash with modules for keys and the required version as values (e.g. \f(CW\*(C`{ Foo => \*(Aq1.234\*(Aq }\*(C'\fR). .IP \(bu 4 phase .Sp The phase of the requirements. This defaults to \f(CW\*(Aqruntime\*(Aq\fR. Other valid values include \f(CW\*(Aqbuild\*(Aq\fR and \f(CW\*(Aqtest\*(Aq\fR. .IP \(bu 4 relation .Sp The relation of the requirements. This defaults to \f(CW\*(Aqrequires\*(Aq\fR, but other valid values include \f(CW\*(Aqrecommends\*(Aq\fR, \f(CW\*(Aqsuggests\*(Aq\fR and \f(CW\*(Aqconflicts\*(Aq\fR. .IP \(bu 4 error .Sp It will die with this error if set. The two messages \f(CW"No support for OS"\fR and \f(CW"OS unsupported"\fR have special meaning to CPAN Testers and are generally encouraged for situations that indicate not a failed build but an impossibility to build. .PP \&\f(CW\*(C`condition\*(C'\fR and one of \f(CW\*(C`prereqs\*(C'\fR or \f(CW\*(C`error\*(C'\fR are mandatory. .PP This takes a filename, that can be either a YAML file or a JSON file, and evaluates it. .SS Conditions .IX Subsection "Conditions" \fIcan_run($command)\fR .IX Subsection "can_run($command)" .PP Returns true if a \f(CW$command\fR can be run. .PP \fIconfig_defined($variable)\fR .IX Subsection "config_defined($variable)" .PP This returns true if a specific configuration variable is defined. .PP \fIhas_env($variable)\fR .IX Subsection "has_env($variable)" .PP This returns true if the environmental variable with the name in \f(CW$variable\fR is true. .PP \fIhas_perl($version)\fR .IX Subsection "has_perl($version)" .PP Returns true if the perl version satisfies \f(CW$version\fR. \f(CW$version\fR is interpreted exactly as in the CPAN::Meta spec (e.g. \f(CW1.2\fR equals \f(CW\*(Aq>= 1.2\*(Aq\fR). .PP \fIis_extended\fR .IX Subsection "is_extended" .PP Returns true if extended testing is asked for. .PP \fIis_os(@systems)\fR .IX Subsection "is_os(@systems)" .PP Returns true if the OS name equals any of \f(CW@systems\fR. .PP \fIis_os_type($type)\fR .IX Subsection "is_os_type($type)" .PP Returns true if the OS type equals \f(CW$type\fR. Typical values of \f(CW$type\fR are \f(CW\*(AqUnix\*(Aq\fR or \f(CW\*(AqWindows\*(Aq\fR. .PP \fIis_smoker\fR .IX Subsection "is_smoker" .PP Returns true when running on a smoker. .PP \fIhas_env\fR .IX Subsection "has_env" .PP This returns true if the given environmental variable is true. .PP \fIwant_xs\fR .IX Subsection "want_xs" .PP This returns true if a compiler appears to be available, and the \f(CW\*(C`pureperl_only\*(C'\fR option has not been set. .PP \fInot\fR .IX Subsection "not" .PP This takes an expression and negates its value. .PP \fIor\fR .IX Subsection "or" .PP This takes list of arrayrefs, each containing a condition expression. If at least one of the conditions is true this will also return true. .PP \fIand\fR .IX Subsection "and" .PP This takes a list of arrayrefs, each containing a condition expression. If all of the conditions are true this will also return true. .SH "POD ERRORS" .IX Header "POD ERRORS" Hey! \fBThe above document had some coding errors, which are explained below:\fR .IP "Around line 170:" 4 .IX Item "Around line 170:" Unknown directive: =method .IP "Around line 186:" 4 .IX Item "Around line 186:" Unknown directive: =method .IP "Around line 216:" 4 .IX Item "Around line 216:" Unknown directive: =method