Problems? Is your data what you think it is? | |
PerlMonks |
Re: Why Closures?by ZZamboni (Curate) |
on Apr 28, 2001 at 21:09 UTC ( [id://76395]=note: print w/replies, xml ) | Need Help?? |
As a simple example of a useful application of closures (and some
interesting discussion) see my
Setting up signal handlers for an object with access to $self
snippet. In this case, you can use closures to store the current
value of a variable ($self in this case) to provide later access
to its current value without having to explicitly store it
anywhere.
--ZZamboni
In Section
Meditations
|
|