[ABE.pm] Functional programming in Perl
Ricardo SIGNES
rjbs-perl-abe at lists.manxome.org
Mon Sep 11 19:38:01 PDT 2006
* "Faber J. Fedor" <faber at linuxnj.com> [2006-09-11T18:39:53]
> Can we do functional programming in Perl as outlined on this page?
>
> http://www.joelonsoftware.com/items/2006/08/01.html
Yes.
sub PutInPot { ... }
Cook('lobster', 'water', \&PutInPot);
Or:
Cook('lobster', 'water', sub { alert("pot $_[0]") });
I use this sort of programming on a daily basis, and it is extremely powerful.
Mark-Jason Dominus's amazing book Higher-Order Perl discusses this kind of
program in great detail and with great clarity.
I'll see if I can't find better free resources for functions-as-data in Perl.
See perldoc perlsub, too
--
rjbs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.pm.org/pipermail/abe-pm/attachments/20060911/8f30ee27/attachment.bin
More information about the ABE-pm
mailing list