Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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 exploiting the Monastery: (6)
As of 2026-02-17 08:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.