in reply to Error Handling.

It's only risky if you don't understand the precedence of the different operators you use or call functions that take a list without supplying parentheses.

In your sample code, everything is great until the print; because you don't say

print("$cod: $msg\n"), return 1;
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.

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 }