Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: reference versus bless

by steves (Curate)
on Jan 15, 2005 at 16:26 UTC ( #422520=note: print w/ replies, xml ) Need Help??


in reply to reference versus bless

To clarify just a bit, you can have references that aren't blessed. As merlyn points out, references to hashes and arrays are used to build complex (often nested) data structures. Perl also offers anonymous hashes and arrays, which are references.

blessing a reference essentially makes it an object. In addition to holding and providing access to its data in the normal ways, a blessed reference also can be used to invoke methods that in the package it's been blessed into. If that package also makes use of @ISA inheritence, then you also inherit methods in a pretty standard object oriented sort of model.


Comment on Re: reference versus bless

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2014-08-01 10:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (2 votes), past polls