in reply to Return Question in Subroutine
You probably don't need the "else" in there, simply return at the end. If your "if-statement" did anything, the return in that block would happen first and you would never get to the second return. If nothing happens, your code would simply skip down to the final return and go back to the main program. I don't think it hurts anything to have it in there, and might be useful in the future if you wanted the routine to do something different if $_[0] was undefined. You might want to ask whomever added it to find out their reasoning for putting the else in there.
A reply falls below the community's threshold of quality. You may see it by logging in. |
|