我有同样的问题,因为某些原因无法在Carp :: croak()中禁用堆栈跟踪.因为堆栈中的每个调用都被认为是"安全的",所以每次croak()
打印出完整的堆栈跟踪.我想为某些电话禁用它.
这是一个例子:
use Carp;
sub this_may_fail {
# Some code...
croak "This call failed!";
}
sub regular_code {
this_may_fail();
}
regular_code();
Run Code Online (Sandbox Code Playgroud)
两个子程序都在同一个包中,因此this_may_fail
会自动标记为安全.有没有办法告诉Carp this_may_fail
应该被视为不安全?