Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Correct way to use stricures in CPAN module

by cLive ;-) (Prior)
on Jul 13, 2017 at 13:52 UTC ( #1195024=perlquestion: print w/replies, xml ) Need Help??
cLive ;-) has asked for the wisdom of the Perl Monks concerning the following question:

Finally got around to uploading my first CPAN module. The nightly test email is still rather exciting - and I'm learning more from this than I thought.

One thing is that strictures doesn't appear to be in core on some versions of perl.

PERL_DL_NONLAZY=1 "/home/cpan/pit/bare/perl-5.14.0/bin/perl" "-MExtUti +ls::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switch +es; test_harness(0, 'blib/lib', 'blib/arch')" t/tests/*/*/*.t t/tests +/*/*/*/*.t t/tests/*/*/*/*/*.t Can't locate in @INC (@INC contains: ##huge @INC removed +##.) at t/tests/lib/Number/MuPhone.t line 1. BEGIN failed--compilation aborted at t/tests/lib/Number/MuPhone.t line + 1. t/tests/lib/Number/MuPhone.t .............. Dubious, test returned 2 (wstat 512, 0x200) No subtests run

From this page I assume I can fix this by adding use 5.012 to the module, yes? Is that the preferred way of "fixing" this for the tests?

Replies are listed 'Best First'.
Re: Correct way to use stricures in CPAN module
by toolic (Bishop) on Jul 13, 2017 at 14:16 UTC
    That article you reference states:
    Perl 5.12 also enables strictures when it encounters use 5.012

    I think the confusion is that the term "strictures" in the article loosely refers to the strict and warnings pragmas, which are part of the Core Perl distribution. The term does not refer to the module, which Corion pointed out is not part of the Core.

    Adding use 5.012; will add strict and warnings, but it will not add strictures.

    UPDATE: corrected mistake.

    For giggles... The strictures, according to Seuss

      Adding use 5.012; will add strict and warnings

      Not quite, use with a version ≥ 5.012 doesn't enable warnings, just strict.

Re: Correct way to use stricures in CPAN module
by Corion (Pope) on Jul 13, 2017 at 13:55 UTC

    strictures was never in core:

    g:\Systeme\Regis-TR\XML>corelist strictures strictures was not in CORE (or so I think)

    You should specify such prerequisites in your Makefile.PL (and from there, in your META.yml and META.json):

    ... PREREQ_PM => { strictures => 0, ...

    Debugging your list of prerequisites is always fun :)

      I noticed there was an omission in my prerequisites for YAML::XS (but I made that optional through an eval, so I figured that was fine).

      Good to know strictures needs to be in the prereq list, but I'm wondering why Makefile.PL didn't pick it up. Hmmm.

Re: Correct way to use stricures in CPAN module
by perlancar (Scribe) on Jul 13, 2017 at 14:43 UTC
    Congratulations, BTW!
      I've only had a PAUSE account for 15 years! :D

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1195024]
Approved by marto
Front-paged by marto
[Eily]: s/complete ness/complete mess/ :P
[Eily]: and you can overload "0+" rather than bool, as numification is used instead of stringification in boolean context when available

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (12)
As of 2017-07-27 14:00 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (415 votes). Check out past polls.