Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: What's it with Perl Syntax ?!

by TomDLux (Vicar)
on Feb 21, 2011 at 15:33 UTC ( #889407=note: print w/ replies, xml ) Need Help??


in reply to Re^2: What's it with Perl Syntax ?!
in thread What's it with Perl Syntax ?!

I've recently been going through a number of the exercises at ProjectEuler. I did find it amusing that some questions turn out to be a one-liner in Perl.

On the other hand, I imagine many people, Perlers or otherwise, would require some hep with

my $sum = reduce {$a + $b } map { .... } grep { ...... } @some_array

Yes, it can be broken into an explicit block, spread of several lines. Besides being more verbose and slower, the block focuses on what happens element by element, while the dense version thinks in terms of the data set.

As Occam said: Entia non sunt multiplicanda praeter necessitatem.


Comment on Re^3: What's it with Perl Syntax ?!
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://889407]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2014-08-01 09:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (258 votes), past polls