I assume you test for definedness (as you mention it in the title) and not for 0 or ''. In that case:
use perl 5.10; $val= return1() // '' . return2();
It might be necessary to add parens if . binds stronger than //
In reply to Re: append return if defined else not
by jethro
in thread append return if defined else not
by tart
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |