my $rc = doThis(); if ( $rc ) { error_routine($rc); # error_routine handles messaging for various errors }