in reply to 'return:' instead of 'return'
I think you are really creating a label named return here, followed by a constant expression. As that expression is the last expression evaluated, it is used as return value.
Look at this code: It returns 5 and gives a "Useless use of a constant in void context" warning:
sub foo { return: 3; return 5; }
Alexander
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: 'return:' instead of 'return'
by Boldra (Curate) on Jun 12, 2009 at 09:31 UTC | |
by bart (Canon) on Jun 12, 2009 at 09:36 UTC | |
by Boldra (Curate) on Jun 12, 2009 at 10:48 UTC | |
by rovf (Priest) on Jun 12, 2009 at 13:15 UTC | |
by bart (Canon) on Jun 12, 2009 at 11:50 UTC |