in reply to Idomatic Handling of Subroutine Error
I've often seen this, which is quite similar:unless ( $result = my_sub() ) { # handle error condition }
where &my_sub might look like this:my $result; unless ( my_sub(\$result) ) { # handle error condition }
andy.sub my_sub { my $r_result = shift; $$r_result = whatever(); was_there_an_error() ? 0 : 1 ; }
|
|---|