That bit sets @Carp::CARP_NOT.  In your code you should be setting
@Your::Module::CARP_NOT.  It's intended to be set just once, like
@ISA, not just before calling carp.

Got it. I think this diff would do. Thanks for the pointer :)


Index: lib/DateTime/Format/Builder.pm
===================================================================
RCS file: /cvsroot/perl-date-time/modules/DateTime-Format-Builder/lib/DateTime/F
ormat/Builder.pm,v
retrieving revision 1.36
diff -d -u -r1.36 Builder.pm
--- lib/DateTime/Format/Builder.pm 30 Jan 2004 07:09:13 -0000 1.36
+++ lib/DateTime/Format/Builder.pm 4 Feb 2004 09:07:14 -0000
@@ -14,7 +14,7 @@
use Params::Validate qw(
validate SCALAR ARRAYREF HASHREF SCALARREF CODEREF GLOB GLOBREF UNDEF
);
-use vars qw( $VERSION %dispatch_data );
+use vars qw( $VERSION %dispatch_data @CARP_NOT );


 my $parser = 'DateTime::Format::Builder::Parser';
 $VERSION = '0.7801';
@@ -201,13 +201,8 @@
 {
     my ($class, $input) = @_;

-    my $pkg;
-    my $i = 0;
-    while (($pkg) = caller($i++)) {
-        last if (!UNIVERSAL::isa($pkg, 'DateTime::Format::Builder') &&
-            !UNIVERSAL::isa($pkg, 'DateTime::Format::Builder::Parser'));
-    }
-    local $Carp::CarpLevel = $i;
+    local @CARP_NOT =
+        qw(DateTime::Format::Builder DateTime::Format::Builder::Parser);
     croak "Invalid date format: $input";
 }

Reply via email to