in reply to How to understand chapter 6 of Higher Order Perl?

This style of programming has a definite (niche, in my opinion) place, in which place it turns out to be quite useful indeed.   I happen to find the quoted bit of syntax (in the OP) to be very obfuscatory, because it is not instantly obvious what the construct “(&)” means ... and, as it turns out, “it means everything.”   Your entire understanding of the example hinges, I think, upon knowing precisely what that ampersand does.   I do not prefer code that is not understandable at a glance by any/everyone who is reasonably familiar with the language.   If I have to stop and think about it ... if I am the slightest bit uncertain ... then I know that my successors will feel the same way (maybe), and that bugs might be the result.   Bugs of the type that are introduced by mis-reading of the source code are very expen$ive.   So, I look for another way to say it, even if the algorithm remains unchanged.

That being said, this is of course meant to be an example, meant to be condensed into just one line and probably being the minimal way to present it.   The book’s author in this case was dealing to the book’s purposes of example, whereas a real-world application of the idea would be different.   In a future edition of the (e-)book, perhaps a few more sentences could be added.

Replies are listed 'Best First'.
Re^2: How to understand chapter 6 of Higher Order Perl?
by Anonymous Monk on Mar 15, 2014 at 09:30 UTC

    In a future edition of the (e-)book, perhaps a few more sentences could be added.

    it already does ... it , page 123, pdf page 141