perl - How can I mark a call as "unsafe" with Carp? -


I have the same problem as every call in the stack is considered "safe", because croak () Every time a full stack prints the trace, I want to disable it for some calls.

Here's an example:

  Use carp; Sub this_may_fail {# some code ... hoarse "call failed!"; } Sub regular_code {this_may_fail (); } Regular_code ();  

Both of the above types are in the same package, so this_may_fail has been automatically marked as safe. Does it tell the carp that this_may_fail should be considered unsafe?

This is regular_code which is defined by the this_may_fail Safe "is considered. Check is based on namespace, so to make it unsafe, you want to keep this_may_fail at a different place name.


Or write your own crocker.

 use  perl -e 'carp qw (); Sub untrusting_croak {Goto & Carp :: croak if $ Carp :: Verbose; My @ Caller = Collar (1); Die (included ("", @_). "$ Collar [1] line $ collar [2] \ n"); } Subf {untrusting_croak ("!!!"); } # Line 9f (); # Line 11 '!!! At-e line 11  

Comments