in reply to How to declare a dependency on PerlIO in a CPAN module?

Hmm ... *cough*

Syntax::Construct, IO::String , https://metacpan.org/pod/CPAN::Meta::Spec#prereqs

prereqs => { runtime => { requires => { 'perl' => '5.006',

perlver / Perl::MinimumVersion,

$ perlver foooooo.pl ----------------------------------------- | file | explicit | syntax | external | | ----------------------------------------- | | foooooo.pl | ~ | v5.8.0 | n/a | | ----------------------------------------- | | Minimum explicit version : ~ | | Minimum syntax version : v5.8.0 | | Minimum version of perl : v5.8.0 | -----------------------------------------

Replies are listed 'Best First'.
Re^2: How to declare a dependency on PerlIO in a CPAN module?
by jcb (Parson) on Sep 01, 2019 at 05:18 UTC

    PerlIO is available and default in perl v5.8.0 and later. It is possible to build perl to not use PerlIO, however.

    I know about the version requirement for PerlIO to be available. I am asking if there is a way, in CPAN metadata, to express that code expects $Config{useperlio} eq 'define' in the build of perl that is running the program, or do I need to consider the "PerlIO not available" case?

      . I am asking if there is a way, in CPAN metadata, to express that code expects $Config{useperlio} eq 'define' in the build of perl that is running the program,

      Why? C-requirements are defined in .c and .h files not in CPAN metadata.

      Which part of which file of your module depends on USE_PERLIO ( "perlio.h" )?

      Why is it important for CPAN metadata to know about C-level requirements ?

      Code in Build.PL/Makefile.PL is often used to check for missing .h or .c level dependencies. Some go a step further with Alien:: modules that install those dependencies.

      You can add in Makefile.PL any check of %Config prerequisites

      Devel::PPPort helps with compiling .xs modules on older versions of perl.h

      or do I need to consider the "PerlIO not available" case?

      Do you? Have you encountered a squeaky wheel that needs grease? cpantesters can help find squeaks

      PerlIO is a module ... but does it depend on USE_PERLIO? (does it matter?)

        Which part of which file of your module depends on USE_PERLIO ( "perlio.h" )?
        Why is it important for CPAN metadata to know about C-level requirements?

        It is important because there are features in the perl core that are available iff PerlIO is used. Unlike most C-level flags, USE_PERLIO has visible effects on Perl code. In particular, if PerlIO is not used, opening a scalar as a file does not work.