I've been testing a lot of modules with bleadperl and have run into a few issues with some modules, but for the most part modules have installed just fine. There have been one rather common issue with some CPAN authors' use of Carp. In normal code, it will probably look like this.
use warnings; use strict; sub complain { require Carp; Carp::carp "This should not work!"; }
Here's a one-liner with Perl 5.8.8 and bleadperl that demonstrates the problem.
[steve@kirk ~]$ perl -Mstrict -Mwarnings \ -le'sub complain{ require Carp; Carp::carp "This should not work!"; } +\ complain' This should not work! at -e line 1 main::complain() called at -e line 1 [steve@kirk ~]$ /tmp/bleadperl/bin/perl5.9.5 -Mstrict \ > -Mwarnings -le'sub complain{ require Carp;\ > Carp::carp "This should not work!"; } complain' String found where operator expected at -e line 2, near "Carp::carp "T +his shoulld not work!"" (Do you need to predeclare Carp::carp?) syntax error at -e line 2, near "Carp::carp "This should not work!"" Execution of -e aborted due to compilation errors.
What's the difference? The code above is relying on some undefined behavior of warnings.pm. warnings used Carp which would invade the namespaces of other modules that used warnings. With change #23768, warnings was changed to only require Carp when it is needed. Without some module using Carp and importing it into the global namespace, it turns into another bareword, unless you put parentheses around your arguments.
[steve@kirk ~]$ /tmp/bleadperl/bin/perl5.9.5 -Mstrict \ -Mwarnings -le'sub complain{ require Carp; \ Carp::carp("This will work!"); } complain' This will work! at -e line 1 main::complain() called at -e line 2
How common is this problem? Common enough, I guess. I’ve so far tested around 800 CPAN distributions with bleadperl, and have seen around ten modules fail with this problem. That’s just over 1% of the modules. This figure may go up or down, since it seems to correlate to the CPAN author, rather than something happening at random. If an author uses the require Carp idiom incorrectly once, it seems pretty likely that they’ll do it again. This may hit non-CPAN code a bit harder since error handling routines are typically copy-and-pasted around or placed in a common module. If done incorrectly, it could bring down an application, or a whole suite of applications.
So, please, please, please, test your modules with bleadperl! Its better to do it now rather than wait for Perl 5.10 to be released. See my signature for details on how to get a bleadperl and test with it.
Steve_p
Test your modules with bleadperl!
rsync -avz rsync://public.activestate.com/perl-current/ . ./Configure -des -Dusedevel -Dprefix=/path/to/test/perl make test make install
Now, please test you modules! If you have test failures that don't happen with Perl 5.8.8, send a simplified test case to
perlbug at perl.org
|
---|