in reply to Re: Testing error handling that calls "die"
in thread Testing error handling that calls "die"
I get it now. I didn't know about the two forms of eval, and that was why I couldn't get my original code or toolic's explanation to work. I will admit that I struggled for a while despite your explanation, as $success did not behave as I expected. I was not mentally prepared for it to return undef on an error and spent quite a while trying to work out what had gone wrong. Trying to debug a non-existent bug is not recommended. :-)
One other thing surprised me slightly. Every use of ok I had seen previously uses brackets, but I notice that your examples do not. I have put brackets in for consistency, but is this just cargo cult? If not, what is the effect of using the brackets?
Regards,
John Davies
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Testing error handling that calls "die"
by moritz (Cardinal) on Dec 27, 2011 at 11:11 UTC |