in reply to Elegant way to return true or nothing from a subroutine?
sub foo { return !! shift->{some_obj}->some_method; }
or even:
sub foo { !! shift->{some_obj}->some_method; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Elegant way to return true or nothing from a subroutine?
by monarch (Priest) on Oct 10, 2006 at 15:34 UTC | |
by fenLisesi (Priest) on Oct 10, 2006 at 16:00 UTC | |
by ikegami (Patriarch) on Oct 10, 2006 at 16:22 UTC |