in reply to reference versus bless
bless() attaches a package name to a reference. If you treat that reference as an object (i.e. call methods on it), that package name tells perl in which package to start looking for that method.
You can still treat a blessed reference as a regular ol' reference, but you can't treat a regular ol' reference as an object. A blessed reference is just a reference with an associated package name.
The blessed reference doesn't provide the interface: it just tells perl which package has it. You have to provide the interface yourself, either directly in that package or in something it inherits.
|
|---|