1. 27

  2. 12

    This book was recommended to me by a senior programmer (my boss) back in 2006-2007. He introduced the book to me as, “This will teach the concepts of functional programming to you in a somewhat FP-hostile environment – Perl. But, it turns out that’s a lovely and fun way to learn the concepts.” At that time, FP wasn’t popular in any mainstream languages (e.g. Java was at 1.x versions headed toward Java 7, Clojure was new or non-existent, and FP was uncommon in JavaScript and Python communities). Meanwhile, in our production environment at a BigCo, Perl was the only dynamic language allowed in real apps, because it was commonly used as a portable alternative to shell scripts. This meant I could toy around with FP concepts while writing “production code” (typically, the wrappers & scripts surrounding our “real” app, which was usually written in Java).

    Higher-Order Perl was an enlightening read and it also gave me a deeper appreciation of Perl as a language for fun “expressivity hacking”. It was also when I started to go down the FP rabbit hole, which eventually led me to FP in JavaScript, Scheme/SICP/Racket, Clojure, etc. So I recall the book fondly! (It was also my last experience with Perl, so I left on a high note!)

    1. 2

      It is said in the preface, I think, that Perl can almost be considered a Lisp, so it isn’t at all surprising that it fits into FP mindset so well. I found the quote from the book:

      The book Paradigms of Artificial Intelligence Programming, by Peter Norvig, includes a section titled “What Makes Lisp Different?” that describes seven features of Lisp. Perl shares six of these features.

      ( Here you can find the original 7 features of Lisp listed in the book mentioned in the quote. )

    2. 11

      I have the dead-tree version of this book, and it’s a pleasure to read.

      1. 5

        The regex as a value generator, as used in this book, is really quite good. I’ve been dying to see somebody write it up and stick it on CPAN.

        1. 3

          Which chapter? any link?

          1. 6

            I think parent comment mentions the Infinite Streams chapter of the book: https://hop.perl.plover.com/book/pdf/06InfiniteStreams.pdf (see page 18 in the link).

            1. 4

              Section 6.5 on page 272 for those just peeking in a browser. Good stuff! Thank you.

              1. 2

                Thanks! much appreciated.