in reply to Elegant way to return true or nothing from a subroutine?
How about:
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 && 1 || return }
Wah! Guess who's been programming in ruby recently. I initially wrote those as sub foo; ...; endsub foo { shift->{some_obj}->some_method || return }
|
---|
In Section
Seekers of Perl Wisdom