Skip Menu |

This queue is for tickets about the Class-Accessor CPAN distribution.

Report information
The Basics
Id: 28586
Status: rejected
Priority: 0/
Queue: Class-Accessor

People
Owner: Nobody in particular
Requestors: fmate14 [...] gmail.com
Cc:
AdminCc:

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



Subject: Carp "bug"
Date: Tue, 31 Jul 2007 15:26:52 +0200
To: bug-Class-Accessor [...] rt.cpan.org
From: FARKAS Máté <fmate14 [...] gmail.com>
Hello. I found a little ,,bug'' in Accessor.pm (version: 0.31), on line 460: Show quoted text
> use Carp (); > > sub _carp { > my ($self, $msg) = @_; > Carp::carp($msg || $self); > return; > }
You load Carp *always*! The better way: Show quoted text
> sub _carp { > my ($self, $msg) = @_; > require Carp; > Carp::carp($msg || $self); > return; > } > sub _croak { > require Carp; > ...
Best regards, Máté -- FARKAS Máté http://fmate14.try.hu/
Subject: Re: [rt.cpan.org #28586] Carp "bug"
Date: Tue, 31 Jul 2007 07:02:01 -0700
To: bug-Class-Accessor [...] rt.cpan.org
From: Michael G Schwern <schwern [...] pobox.com>
FARKAS Máté via RT wrote: Show quoted text
> I found a little ,,bug'' in Accessor.pm (version: 0.31), > on line 460:
>> use Carp (); >> >> sub _carp { >> my ($self, $msg) = @_; >> Carp::carp($msg || $self); >> return; >> }
> > You load Carp *always*! The better way:
>> sub _carp { >> my ($self, $msg) = @_; >> require Carp; >> Carp::carp($msg || $self); >> return; >> } >> sub _croak { >> require Carp; >> ...
requiring Carp at the last possible moment was done for micro load-time efficiency purposes. Carp has long since been changed to do this for you (see Carp::Heavy). Its likely the current way has no impact on performance with a modern perl.