in reply to Error Handling.
In your sample code, everything is great until the print; because you don't say
it will assume print("$cod: $msg\n", return 1) so the return will actually happen as it is trying to build the list of parameters for print, and the print itself will never be issued.print("$cod: $msg\n"), return 1;
This kind of mistake is a pain to find; since you've done it once, I'd eschew this style of error handling and just go with:
if (error condition) { set stuff print message return }
|
|---|