- or download this
unless ( $result = my_sub() ) {
# handle error condition
}
- or download this
my $result;
unless ( my_sub(\$result) ) {
# handle error condition
}
- or download this
sub my_sub {
my $r_result = shift;
$$r_result = whatever();
was_there_an_error() ? 0 : 1 ;
}