Skip Menu |

This queue is for tickets about the rpm-build-perl CPAN distribution.

Report information
The Basics
Id: 22512
Status: resolved
Priority: 0/
Queue: rpm-build-perl

People
Owner: Nobody in particular
Requestors: SMPETERS [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: (no value)
Fixed in: (no value)



Subject: [PATCH] Fix for Bareword "Carp::confess" not allowed while "strict subs"
Currently, I'm getting errors when trying to use B::PerlReq. The error I get is that Perl is thinking Carp::confess is a bareword. Adding parentheses seems to fix the problem. My patch is attached below. --- lib/B/PerlReq.pm.old 2006-10-23 12:50:58.000000000 -0500 +++ lib/B/PerlReq.pm 2006-10-23 12:55:37.000000000 -0500 @@ -329,7 +329,7 @@ $| = 1; local $SIG{__DIE__} = sub { print STDERR "# died at $0 line $CurLine:\n# @_"; - require Carp; Carp::confess; + require Carp; Carp::confess(); }; grok_blocks(); grok_main();
On Mon Oct 23 14:04:10 2006, SMPETERS wrote: Show quoted text
> Currently, I'm getting errors when trying to use B::PerlReq. The
error Show quoted text
> I get is that Perl is thinking Carp::confess is a bareword. Adding > parentheses seems to fix the problem. My patch is attached below.
Thanks for the report. Which version of perl do you use? Does `perl -c lib/B/PerlReq.pm' pass syntax check?
It looks like that with perl-5.8.x, Carp is already preloaded somewhere in BEGIN. I checked and I think it is warnings.pm. If you use recent perl-5.9.x, warnings.pm now modified to load Carp.pm as needed. So 'Carp::confess' bareword is suddenly a problem. And warnings.pm is preloaded from vars.pm, which is preloaded from File/Spec.pm. Guess what. That's cool!
From: SMPETERS [...] cpan.org
On Thu Oct 26 23:52:44 2006, ATOURBIN wrote: Show quoted text
> It looks like that with perl-5.8.x, Carp is already preloaded > somewhere in BEGIN. I checked and I think it is warnings.pm. If you > use recent perl-5.9.x, warnings.pm now modified to load Carp.pm as > needed. So 'Carp::confess' bareword is suddenly a problem. > > And warnings.pm is preloaded from vars.pm, which is preloaded from > File/Spec.pm. Guess what. That's cool!
Yes, I did test this with Perl 5.9.5 to help make sure modules are working with bleadperl in preparation for the eventual Perl 5.10 release. You're also correct that a change in warnings.pm to stop Carp from being loaded with warnings (and lower the memory used) is the cause of this suddenly appearing.
Fixed in 0.6.2.