http://www.perlmonks.org?node_id=1086164


in reply to Re: Object Oriented Perl - very basic guide
in thread Object Oriented Perl - very basic guide

You can even bless a scalar
Just for clarification (you meant that of course): You cannot bless a scalar, you can bless a reference to a scalar (as any other type of reference - I would recommend to bless a directory handle :-)
  • Comment on Re^2: Object Oriented Perl - very basic guide

Replies are listed 'Best First'.
Re^3: Object Oriented Perl - very basic guide
by choroba (Cardinal) on May 15, 2014 at 15:36 UTC
    You didn't quote the whole phrase: You can ever bless a scalar (...) or code reference.
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

      If you parse that as "(a ((scalar or code) reference)" then what you said wasn't wrong. However, if you parse that as "(a (scalar) or (code reference))" like morgon and I did, then you'll have to admit that morgon has a point.

      However, a reference is a scalar of course, so technically a claim that "you can even bless a scalar" isn't incorrect as much as it's redundant, given that you can only bless references :)