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

Re: [perl #56150] return return

Thread Previous | Thread Next
June 22, 2008 20:49
Re: [perl #56150] return return
Message ID:
On Sunday 22 June 2008 16:08:22 Mark Mielke wrote:

> Perl programmers *must* be accustomed to code blocks returning the last
> value. This is how grep and map work. Any Perl programmer that cannot
> read this comfortably will have problems with these basic functions. If
> the programmer needs an explicit "return" to tell them what is
> happening, I would suggest it isn't about machine vs people but Perl vs
> C/Java.

I don't know about your code, but my map and grep blocks tend to be much 
shorter than my functions and methods -- shorter even than my for and while 
loop blocks (which don't explicitly return anything).

-- c

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About