in reply to Why are closures cool, continued?
sub new { my ($class, @stuff) = @_; return bless sub { doit(@stuff, @_) },$class; }
Now, if you want what i consider to be a good, everyday, pratical solution that uses a closure (not just a crazy way to make eyes go cross-eyed), then check out (the recently renamed) (jeffa) Practical Use For What jeffa Thought A Closure Was (3Re: Style Question on Closures). There are, of course, many more practical uses for closures ... this one has served me well, and i really think that it is easy to understand.
UPDATE: nope - i am wrong again. Sorry mr.dunstan. Thanks for the catch perrin.
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: (jeffa) Re: Why are closures cool, continued?
by perrin (Chancellor) on Jan 19, 2002 at 03:34 UTC | |
by dws (Chancellor) on Jan 19, 2002 at 04:37 UTC | |
by perrin (Chancellor) on Jan 19, 2002 at 05:57 UTC | |
by mr.dunstan (Monk) on Jan 19, 2002 at 03:42 UTC | |
by perrin (Chancellor) on Jan 19, 2002 at 03:56 UTC |