in reply to Calling sub's: return true
First, I hope you mean that you're dividing your code into separate modules (using package) for a clean distinction among responsibilities. It is fundamental to creating maintainable software that you think critically about what parts of your code naturally belong together, and which ought to be split off into separate namespaces. The approach you're taking now feels easier to you as the author, because you're already familiar with the code. But the person coming along after you will have a terrible time making sense of the codebase.
Second, what you're seeing is the fact that the subroutine is returning the result of the last evaluated expression. Unless it's a number less than 1, undef, or the empty string, you had a success. So, the short answer to your question is that you can say return undef at the close of that sub if you really want it to be silent. However, there are three reasons (at least) that you do not want to do this:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Calling sub's: return true
by FamousLongAgo (Friar) on Jan 11, 2003 at 03:05 UTC |