Well, you could do something like this:
sub test_sub {
my $error_msg = sub1() || sub2() || sub3();
return $error_msg;
}
This works because (quoting from perlop) "Binary "||" performs a short-circuit logical OR operation.
That is, if the left operand is true, the right operand is not even evaluated",
so $error_msg will contain the first non-zero return
value or zero if all subs are successful, and no more subroutines
are called after one has returned a non-zero value.
Of course, if your program does other things between each
subroutine call then this won't help.