You're after something like this:
unless ( $result = my_sub() ) { # handle error condition }
I've often seen this, which is quite similar:
my $result; unless ( my_sub(\$result) ) { # handle error condition }
where &my_sub might look like this:
sub my_sub { my $r_result = shift; $$r_result = whatever(); was_there_an_error() ? 0 : 1 ; }
andy.

In reply to Re: Idomatic Handling of Subroutine Error by andye
in thread Idomatic Handling of Subroutine Error by dvergin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":