|
|
| No such thing as a small change | |
| PerlMonks |
Re^3: Real life uses for closures.by tobyink (Prior) |
| on Feb 13, 2013 at 13:14 UTC ( #1018534=note: print w/ replies, xml ) | Need Help?? |
|
Technically none of the examples from Sort::MultipleFields employ closures; they just use anonymous functions. Closures "close over" a variable.
package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||