in reply to Re^5: return from external subroutine
in thread return from external subroutine

The same rules as returning from a sub apply. If there's a return, the value there gets returned per the normal rules. If there's no return, the value of the last evaluated expression gets returned. The most correct way to end a module is with an explicit return.

Replies are listed 'Best First'.
Re^7: return from external subroutine
by CountZero (Bishop) on Aug 25, 2007 at 20:53 UTC
    Thank you for this explanation! Scarcely a day goes by without increasing my knowledge when visiting this site.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James