iaw4 has asked for the wisdom of the Perl Monks concerning the following question:
looks ugly. what I would prefer is(cond1 && cond2) and do { $@="message"; return; };
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 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(cond1 && cond2) and return signalerror "message";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: abbreviate 'do { $@="blah blah"; return undef; };
by Corion (Patriarch) on Jan 25, 2012 at 17:49 UTC | |
|
Re: abbreviate 'do { $@="blah blah"; return undef; };
by stonecolddevin (Parson) on Jan 25, 2012 at 17:47 UTC | |
|
Re: abbreviate 'do { $@="blah blah"; return undef; };
by JavaFan (Canon) on Jan 25, 2012 at 18:02 UTC | |
|
Re: abbreviate 'do { $@="blah blah"; return undef; };
by tobyink (Canon) on Jan 25, 2012 at 23:03 UTC |