dear perl monks: I would like to mimick eval in its return scheme: $@ stores a message, and the routine returns undef; right now, I am writing
(cond1 && cond2) and do { $@="message"; return; };
looks ugly. what I would prefer is
(cond1 && cond2) and signalerror "message";
of course, the problem is that a sub signalerror returning undef will not return one level up. I could write something like
(cond1 && cond2) and return signalerror "message";
but at this point, my syntax looks about as painful. is there a way to coax perl to expand signalerror into $@=message and then return undef?
/iaw