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>.