in reply to Returning string and numerical data types from subroutines

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.


Be Appropriate && Follow Your Curiosity
  • Comment on Re: Returning string and numerical data types from subroutines