Beefy Boxes and Bandwidth Generously Provided by pair Networks
Joe go ahead... be a heretic  When would you use functional
programming?  by Ovid (Cardinal) on Oct 16, 2002 at 18:50 UTC
( #205797=perlmeditation: print w/ replies, xml ) Need Help??
I've been doing a little research into the strange world of
functional programming using Haskell. It's an interesting
language and I was playing with it to improve my understanding
of how functional programming works with Perl. I feel that I
have a fine grasp on map, grep, sort, closures and other aspects
of Perl that are related to functional programming. Further, I'm
familiar with Why I like Functional Programming by tilly.
However, I would love to see more examples of how things are
done in a functional manner in Perl. For example, in Perl, to
compute the product of all of the elements of a list, we might
do the following:  my @list = qw/ 7 5 2 2 /; my $prod = shift
@list; $prod *= $_ foreach @list;  In Haskell, this would be
illegal because variables are defined