http://www.perlmonks.org?node_id=577369


in reply to Elegant way to return true or nothing from a subroutine?

How about:
sub foo { shift->{some_obj}->some_method && 1 || return }
Personally I think your attachment to requiring that all your true values be 1 is vaguely silly. A better solution would seem to be:
sub foo { shift->{some_obj}->some_method || return }
Wah! Guess who's been programming in ruby recently. I initially wrote those as sub foo; ...; end