Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the WWW-Mechanize CPAN distribution.

Report information
The Basics
Id: 4523
Status: resolved
Priority: 0/
Queue: WWW-Mechanize

People
Owner: Nobody in particular
Requestors: william_g_davis [...] users.sourceforge.net
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 0.69_01
Fixed in: (no value)



Subject: Remove Carp.pm checking from _warn and _die.
I would suggest removing the install checking for Carp.pm and just use()ing Carp.pm like normal. A cursory examination of perldelta tells me that Carp.pm has been part of the standard distribution for at least since 5.004 (minus cluck()), but most likely for far, far longer, so checking whether or not it's installed is really not necessary. This is especially true since you make use of comparatively new features like our(), which was introduced in 5.6.1, and qr//, which was added in 5.005, which means anyone doing anything with WWW::Mechanize has Carp. But even if you think it's still a good idea to check, at very least, why not replace the eval STRINGs with eval BLOCKs? eval { require Carp } would have same desired effect as eval "require Carp"; require()ing Carp.pm at runtime or setting $@ if it can't, only the first is compiled at compile time with everything else, and then run each time you call the _warn/_die sub, whereas the second is compiled the first time you call the sub and then needlessly recompiled each time the sub is called. See <perldoc -f eval>.
Show quoted text
> I would suggest removing the install checking for Carp.pm and just > use()ing Carp.pm like normal. A cursory examination of perldelta > tells me that Carp.pm has been part of the standard distribution > for at least since 5.004 (minus cluck()), but most likely for far,
So it does. I don't know why I was thinking that Carp wasn't core. Thanks, xoxo, Andy