If you want to cater for being called in a list context, I'd use
sub foo { return !!shift->{some_obj}->some_method() || (); }
In reply to Re: Elegant way to return true or nothing from a subroutine?
by BrowserUk
in thread Elegant way to return true or nothing from a subroutine?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |