develooper Front page | perl.perl5.porters | Postings from June 2008

Re: [perl #56150] return return

Thread Previous | Thread Next
From:
Abigail
Date:
June 25, 2008 09:37
Subject:
Re: [perl #56150] return return
Message ID:
20080625140222.GC8495@almanda
On Fri, Jun 20, 2008 at 08:04:27AM -0700, Nicholas Clark wrote:
> 
> $ ./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).


Well, some people think that always using a 'return' makes code 
easier to understand. Clearly, 'return return' makes it even easier.


Abigail

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About