Re: how to catch die in a module

2019-08-08 Thread Shlomi Fish
Hi, On Thu, 8 Aug 2019 08:21:24 +0530 Chankey Pathak wrote: > You can create a signal handler for die and handle the exception in there. > Refer https://users.cs.cf.ac.uk/Dave.Marshall/PERL/node116.html > Also see block eval - https://perldoc.pl/functions/eval - or one of its wrappers like htt

Re: how to catch die in a module

2019-08-07 Thread Eliza
Hi all, Try::Tiny seems work fine to me. thanks. 在 2019/8/8 14:19, Shlomi Fish 写道: You can create a signal handler for die and handle the exception in there. Referhttps://users.cs.cf.ac.uk/Dave.Marshall/PERL/node116.html Also see block eval -https://perldoc.pl/functions/eval - or one of its

Re: how to catch die in a module

2019-08-07 Thread Andrew Solomon
Hi Eliza, For a simpler approach without "action at a distance" wrap the call which might trigger the die in an eval. For example: https://gist.github.com/andrewsolomon/e43522deebd71c6539ed12026f82788b Once you feel comfortable with this you can explore various libraries for handling this in a m

Re: how to catch die in a module

2019-08-07 Thread Chankey Pathak
You can create a signal handler for die and handle the exception in there. Refer https://users.cs.cf.ac.uk/Dave.Marshall/PERL/node116.html On Thu, 8 Aug, 2019, 8:15 AM Eliza, wrote: > Hello, > > I use such a module from other people. > In this module there is the "die" statement, for example, >

how to catch die in a module

2019-08-07 Thread Eliza
Hello, I use such a module from other people. In this module there is the "die" statement, for example, connect(...) or die $!; Then my main program will die follow up this "die". But I don't want the caller to die even if "die" was happened in the module. How to handle with it? Thank you. Eli