"be consistent" | |
PerlMonks |
Re^2: How to get content of an XML::easytree outputby tobyink (Canon) |
on Mar 08, 2013 at 06:44 UTC ( [id://1022347]=note: print w/replies, xml ) | Need Help?? |
Personally, I'd prefer:
Update: just for the heck of it, this ain't too bad either:
Using postfix for to temporarily alias $_ is an idiom I don't see used very much, but is quite cute, and in this case has no speed penalty (quite the opposite in fact)...
(PS: kcott's follow-up was posted before this update, so please don't read it as necessarily endorsing the for postfix technique.)
package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
In Section
Seekers of Perl Wisdom
|
|