in reply to Re^6: 'return:' instead of 'return'
in thread 'return:' instead of 'return'
Leaving aside Corions excellent answer why the built-in return never returns a value, if it did I would expect it to return the same value it returns to the caller. I.e. print return 3; would print 3. Returning a boolean value would only make sense if there were a chance return might fail or return might not always return from the subroutine. Then true or false would inform about the success of the operation.
You always have the option to write your own function 'myspecialreturn()' that returns only on some conditions (like the result of Want for example).
|
|---|