Can't this be done with the @CARP_NOT variable?
Hmmm, I was trying to do this:
sub on_fail { my($class, $input) = @_; local @Carp::CARP_NOT = qw( PKGS ... ); croak $input; }
But somehow the messages where unaltered, so now I look at Carp.pm from my perl 5.8.3, and I see the following:
sub shortmess { # Short-circuit &longmess if called via multiple packages { local $@; require Carp::Heavy; } # XXX fix require to not clear [EMAIL PROTECTED] # Icky backwards compatibility wrapper. :-( my $call_pack = caller(); local @CARP_NOT = caller(); # <<< RIGHT HERE shortmess_heavy(@_); }
Hmph. local @CARP_NOT = caller()? It's overriding @CARP_NOT regardless of what the caller has done...?
Dave, mind if I just fall back to what I initially proposed?
--d