Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: Interpolation: when it occurs? another beginner question..by tobyink (Canon) |
on Feb 25, 2013 at 13:33 UTC ( [id://1020521]=note: print w/replies, xml ) | Need Help?? |
OK, I see what you're asking. You want delayed evaluation - I'll update with a solution to that momentarily! Update: OK, how about this...
Update II (about a week later): I've released String::Interpolate::Delayed using some of the ideas explored in this thread.
package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
In Section
Seekers of Perl Wisdom
|
|