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

Re: Does this ctor make sense?

by theshz (Sexton)
on Jan 15, 2013 at 17:56 UTC ( [id://1013433]=note: print w/replies, xml ) Need Help??


in reply to Does this ctor make sense?

I think the OP's question is whether he needs to capture the result of bless and return that. In other words, does "bless" actually change the reference. This was explained well in the book "Object Oriented Perl", bless does change the referant, so you do not need to capture the result. You can use ref to inspect the reference:
my $this = {}; print ref $this; # prints HASH bless $this; print ref $this; # prints main, or Foo if you used: bless $this, FOO

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1013433]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-03-19 08:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found