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


in reply to what's difference between bless and tie?

bless allows you to calls methods on the blessed object.

tie allows you to override built-in operations on variables, namely reading from/assigning to scalars, and list and hash operations like indexing, exists, delete etc.

So in some sense, tie works on a variable and bless works on a thing that is stored in a variable.

  • Comment on Re: what's difference between bless and tie?

Replies are listed 'Best First'.
Re^2: what's difference between bless and tie?
by anaconda_wly (Scribe) on Jan 07, 2013 at 09:02 UTC
    "bless allows you to calls methods on the blessed object." , and "the blessed object" actually a data structure saying a hash and bless tells Perl how the hash can be used(methods defined in package). I still feel they're hard to distinguish in their very initial goal.