How can I replace all 'die's with 'confess' in a Perl application?

后端 未结 4 1308
迷失自我
迷失自我 2021-02-02 13:56

I\'m working in a large Perl application and would like to get stack traces every time \'die\' is called. I\'m aware of the Carp module, but I would prefer not to search/replace

4条回答
  •  被撕碎了的回忆
    2021-02-02 14:42

    Use Devel::SimpleTrace or Carp::Always and they'll do what you're asking for without any hard work on your part. They have global effect, which means they can easily be added for just one run on the commandline using e.g. -MDevel::SimpleTrace.

提交回复
热议问题