A test in a CPAN module that I support is failing on a tester's 5.8.8 install. It passes on mine. Both are linux x86_64, but different distributions. It also passes on many other tester's machines - and this tester's other Perl versions.

The test constructs a string with a series of sprintf()s, then uses Test::More's like() to see if it contains a few key lines. This amounts to a $string =~ qr'^stuff$'ms. Precisely:
like( $string, qr'^-----BEGIN PUBLIC KEY-----$'ms, 'string includes public key PEM' );
I have no clue why this should fail in only one place. This is CPANTS automated testing, so I have no access to the machine.

I don't want to dismiss this as a test artifact in case there's some coding practice that breaks compatibility back to 5.8.8. So I'd like to understand what's going on.

Here is an abbreviated copy of the test report that shows the essentials (note that the ' # ' is added by Test:More and is NOT in the string that's tested).

... # fe5cf495e65e00567724a3964c5f47020301 +0001 # -----BEGIN PUBLIC KEY----- # MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC95h0aRkhNcqBrktxNXzOGgurp +/vkUDFKNda/r # uTMeOlPvXRGIS+kWm8tbahrEXp47bOu1usA7k2EWLQyqm5sdjwXtVyLos5Nw18hG +2acHqbQSV8Zt # YPR8xwpXzZYdFghwVo/Clu3jD1c5Cm0oofZSD/5c9JXmXgBWdySjlkxfRwIDAQAB # -----END PUBLIC KEY----- # keylen : 1024 ... # doesn't match '(?ms-xi:^-----BEGIN PUBLIC KEY-----$)' # Failed test 'string closes public key PEM' # at t/02_base.t line 628. # 'Version : v1

There are 4 instances (subtests) in the test where I inspect this string for (different) strings with this idiom. Even stranger, only 3 of the 4 fail. The full report is at http://www.cpantesters.org/cpan/report/5a7fea9c-8c2a-11e6-a72b-5eeabb799c77?raw=1

The full matrix shows 80 configurations passing...

Any clues would be appreciated. Many thanks!


In reply to RegExps failing on (some) 5.8.8 by tlhackque

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.