Syntactic Confectionery Delight | |
PerlMonks |
Re: help with referencesby tobyink (Canon) |
on May 04, 2013 at 19:22 UTC ( [id://1032075]=note: print w/replies, xml ) | Need Help?? |
$h{2} isn't a reference to $h{1}. $h{2} is a reference to the same array that $h{1} refers to. I think you probably want:
Or (more concise way of saying the same thing)...
package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
In Section
Seekers of Perl Wisdom
|
|