develooper Front page | perl.perl5.porters | Postings from October 2017

How is Carp's @CARP_NOT supposed to work?

Daniel Böhmer
October 3, 2017 23:12
How is Carp's @CARP_NOT supposed to work?
Message ID:
Hi Perl5 developers,

I've tried to reduce the use of $Carp::CarpLevel in some CPAN module and
found that @CARP_NOT works differently than I understood it. It calls
other code and currently uses `local $Carp::CarpLevel += 2` to reference
the user code in a croak() message.

The test file for @CARP_NOT's logic claims it is transitive. So I 
that pushing several package names to @CARP_NOT in a module low in the
stacktrace effectively excludes these packages from error messages
creates above in the stacktrace.

I edited the test file based on the current `bleed` branch to verify my
understanding of the situation. See the diff for an example for the
description above.

Please have a look at the test file and tell me

- whether @CARP_NOT has ever been supposed to work like this

- whether @CARP_NOT could be extended to work like this and if you
support such a change

Kind regards
Daniel Böhmer alias DBOEHMER Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About