2008/6/20 via RT Nicholas Clark <perlbug-followup@perl.org>: > > $ ./perl -Ilib -e 'sub foo {return return}' > $ > > How come this isn't a syntax error? It can't possibly do anything useful. > (Actually, it seems that anything can be passed the return value of return. > C<print return> works just fine). return is technically parsed as a list operator (LSTOP). That enables using it in compound expressions. Note that this syntax works also for other control flow statements : $ perl -wle '$i=3;while(1){print($i--||last)}' 3 2 1 I don't really see a reason to change it.Thread Previous | Thread Next