![]() |
|
Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: Bless and Doby LanX (Bishop) |
on Jun 17, 2014 at 16:08 UTC ( #1090164=note: print w/replies, xml ) | Need Help?? |
One can bless only references, but all kind of references! While the "standard" is to bless hash-refs, there are occasions where blessing array-refs or code-refs or even scalar-refs make much sense. BUT there is no "literal notation" for scalar-refs (like [...] or sub{...} )! That's why a do construct is used, to avoid temporary variables¹. IIRC does TheDamian talk about this in his (recommended!) PBP book. HTH! :)
Cheers Rolf (addicted to the Perl Programming Language)
update¹) like
In Section
Seekers of Perl Wisdom
|
|