Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: Re: Unblessed Reference Message

by converter (Priest)
on Jan 26, 2003 at 21:36 UTC ( #230051=note: print w/replies, xml ) Need Help??

in reply to Re: Unblessed Reference Message
in thread Unblessed Reference Message

A ref becomes an object after being blessed, as now Perl knows who/what it is.

This is incorrect, and will eventually bite you in the rear end. From perlfunc:

bless REF,CLASSNAME bless REF This function tells the thingy referenced by REF that it is now an object in the CLASSNAME package...

It is the thing referred to, not the reference, that is blessed. This is why we can copy the reference returned by bless and still invoke methods against the reference--perl knows that the reference refers to an object of class class because it's the referent that is marked as belonging to a particular package.

Replies are listed 'Best First'.
Re: Re: Re: Unblessed Reference Message
by pg (Canon) on Jan 26, 2003 at 21:55 UTC
    Thank you for making what I said more formal, but to be honest, I mean exactly the same thing, and I didn't expect people to misunderstand it. (Or to be precise, you correctly understood what was on the screen word by word, but had the wrong expectation.)

    This is a good lesson, and I will try to make my wording more formal.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://230051]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2018-04-24 17:41 GMT
Find Nodes?
    Voting Booth?