in reply to testers.cpan vs perl 5.8

The way I understand it, if the Makefile.PL blows up it will not continue with the install. If you are truly concerned about it why not write a unit test that fails if you a version earlier than 5.8? That might be the easiest way of preventing that from installing.

If you are writing something that has to be compatible with a lower version I would use syntax that both versions can understand. The 'open my $out' syntax is easier to read but obviously does not pass PBP compliance. I would disable PBP compliance checking for that syntax and use syntax that is portable as long as portability is the issue.

Replies are listed 'Best First'.
Re^2: testers.cpan vs perl 5.8
by jettero (Monsignor) on May 15, 2007 at 19:29 UTC
    The requirements in the Makefile.PL serve a much different role than the tests.

    I'm interested in informing the CPAN.pm of the higher perl version requirement, similar to PREREQ_PM => { "module::name" => 1.0 } rather than just crashing the thing during install or testing.

    The difference is that, when a module is missing, ExtUtils::MakeMaker announces, "Warning: prerequisite "module::name" 1.0 not found." rather than just crashing. That tells CPAN to go get that thing.

    I remember back in the olden days, a lot of modules would require perl 5.6 and cpan would keep trying to download perl-5.6.tar.gz. That was irritating on dialup. Perhaps they removed the automatic perl version requirements because of that or perhaps "use 5.008001" is the correct way. I do not know.

    -Paul

      The correct way is "use 5.008". (You probably don't want to "use 5.008001", as that will also kill the Makefile.PL on perl 5.8.0.)

      I don't know for a fact that CPAN.pm will handle that correctly, but I would be surprised if it didn't - and if you find that it doesn't handle it correctly then a bug report is in order.

      If you have perl 5.6 and you want to check, try installing Net-SSH2-0.09 (whose Makefile.PL does "use 5.008") using CPAN.pm.

      Of course, if there once was a version of CPAN.pm that didn't do the right thing, then it's quite possible that some people are still using that version ... probably not much you can do about that. (I expect that the cpan testers would be using an uptodate and relatively bug-free version of CPAN.pm.)

      Cheers,
      Rob
      I remember back in the olden days, a lot of modules would require perl 5.6 and cpan would keep trying to download perl-5.6.tar.gz. That was irritating on dialup.

      Ah, fond memories. This was a bug in the dependency analysis of CPAN.pm itself. Andreas König fixed up CPAN.pm to avoid doing this. But you still had to upgrade your local CPAN distribution to get the fix.

      • another intruder with the mooring in the heart of the Perl