http://qs321.pair.com?node_id=11145213


in reply to Re^3: 'perl Makefile.PL' warning for v5.20 to v5.24
in thread 'perl Makefile.PL' warning for v5.20 to v5.24

G'day Rob,

"Are you able to verify that the abstract does, in fact, =~ m![[:cntrl:]]+! in perl-5.20 but not in perl-5.26 and later ?"

The short answer is "Yes".

The longer answer is tad more complicated because the code that would demonstrate this is from $work. I basically ran a GitLab CI/CD pipeline with 14 jobs. Each job used a different docker Perl image: perl:5.16 to perl:5.36 plus three others to cover deltas that indicated some backward-incompatibility in subversions (follow the footnote link in the OP for more details). The output from those jobs only showed the warning in v5.20 to v5.24.

There was only the one source Perl module. It was very old, created long before I joined the company, and every line ended with a CR-LF. When I removed the CR, the warnings disappeared for all the v5.20 to v5.24 jobs; the output for the remaining jobs was unchanged.

I suspect the module was originally written on an MSWin platform for ActivePerl/Strawberry Perl/whatever and then migrated to a Linux box without any line-ending conversions (but that's very much a guess).

And, as a further guess, the way $self->{ABSTRACT} is assigned its value, has something to do with it.

— Ken

Replies are listed 'Best First'.
Re^5: 'perl Makefile.PL' warning for v5.20 to v5.24
by syphilis (Archbishop) on Jul 02, 2022 at 02:18 UTC
    And, as a further guess, the way $self->{ABSTRACT} is assigned its value, has something to do with it.

    It's all very strange.
    I, in fact, did get to wonder whether the change was in the assignment of $self->{ABSTRACT}, and *not* in the behaviour of $self->{ABSTRACT} =~ m![[:cntrl:]]+!
    However, I didn't really look at how the former was being assigned.

    If I could reproduce the issue I reckon I'd be wanting to understand it.
    But I can't reproduce it ... so it's really not all that important to me. (I guess I just find it "intriguing" rather than "important".)

    To satisfy my own curiosity, I fiddled about with the following script, on both Linux and Windows:
    use strict; use warnings; my $count = 0; for my $s(chr(13) . chr(10), chr(10) . chr(13), chr(10) , chr(13) , '0' . chr(13) . chr(10), '0' . chr(10) . chr(13), '0' . chr(10) , '0' . chr(13) , ) { $count++; print "$count match\n" if ($s && $s =~ m![[:cntrl:]]+!); }
    But it just outputs:
    1 match 2 match 3 match 4 match 5 match 6 match 7 match 8 match
    on every perl I run it on.
    So I don't understand how a lone \r is being treated differently to a lone \n or \r\n in some cases for you.

    Cheers,
    Rob

      Thanks for your investigations into this.

      While I don't really like these sorts of loose ends and things I don't fully understand, at the end of the day it's a very minor issue. I can easily change the line endings with a short one-liner: there's quite a swag of legacy code like this that I'll need to deal with in the not too distant future. And, if I don't change them, the warning is harmless as far as I can tell: there's no indications of side-effects or other problems waiting in the wings.

      Perhaps bingos will have an answer; although, I don't think he visits very often. I've encountered his name on many occasions in CPAN testers reports and the acknowledgements section of deltas; however, checking his Writeups, his last post was over seven years ago in 2015.

      — Ken

        > Perhaps bingos will have an answer; although, I don't think he visits very often. I've encountered his name on many occasions in CPAN testers reports and the acknowledgements section of deltas...

        I've toasted his name on many occasions, once even all night long:

        ... the pizza and beer helped a great deal, generously donated by adamk in response to Chris Williams, aka bingos, winning the "The Sydney.pm Less-Than-A-Metre-Of-Beer Challenge", where adamk clarified an important prize condition: "I will force Sydney.pm to toast your name for every beer they open, all night". I can confirm that adamk did indeed enforce this condition and that every single beer opened on the night was accompanied by a loud and raucous "Cheers, Chris Williams!", even a hip-hip-hooray at one point...

        ... so if he does visit us and provide an answer, I suggest we all open a beer, and loudly shout "Cheers, Chris Williams!" :)