You may benefit from some time with Perl Best Practices. The chapter on Error Handling addresses this issue.
Specifically, as two other posters suggested, throw an exception rather than reply on the caller to check the return value. This approach would address the issue you have with interpreting the return code while also creating more robust (where robust is works as you intend and fails at the right time) code.
In reply to Re: Returning string and numerical data types from subroutines
by mikeraz
in thread Returning string and numerical data types from subroutines
by saurabh.hirani
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |