Functional Programming in Perl: Part 2

* Closures

Lets take a look on closures:-

Need of closures:

Since closures are subroutine references with a bit of private data thrown in, they are very convenient to use as callback procedures in graphical user interfaces. There is a nice example which explains the need of using closures. This commonly used approach is called “smart” callback procedure.

For more info you can read chap 4 of Advanced Perl Programming by Sriram Srinivasan.

One Reply to “Functional Programming in Perl: Part 2”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.