Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
#include disclaimer on why one-liners are generally undesirable. Consider a ternary operator. Specifically:
You could then make this function:
Note also - return is (almost) redundant if it's the last line of the code - by default Perl returns from a sub 'the result of the last operation'. This too though, isn't always a good thing, because readable code almost always trumps really short code. In reply to Re: wantarray alternative
by Preceptor
|
|