|
|
|
Clear questions and runnable code get the best and fastest answer |
|
| PerlMonks |
Re: More efficient dereferencing of a subroutine returnby tobyink (Prior) |
| on Feb 17, 2013 at 22:54 UTC ( #1019228=note: print w/ replies, xml ) | Need Help?? |
|
This is fewer lines of course, and arguably a bit neater than a temporary variable, but in terms of real efficiency (i.e. CPU, memory, etc) makes very little difference.
package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
In Section
Seekers of Perl Wisdom
|
|