|laziness, impatience, and hubris|
Re: How best to learn OO Perl?by nothingmuch (Priest)
|on Jul 03, 2006 at 00:47 UTC||Need Help??|
You can look at Moose, which makes OO writing pretty easy.
A class is declared as:
a package is a symbol table namespace, in which symbols are stored. Every class has it's own package which it lives in.
Every class gets DESTROY called right before it's garbage collected. You can hook to that. C<Moose> let's you specify sub DEMOLISH which does not have to call the super class's destructors.
Inheritence is controlled with the special variable @ISA in every package, which contains a list of base classes. YOu can use the extends keyword in Moose to clean that up a bit.
Accessors are autogenerated for you when you use attributes, like:
I don't know what you mean by contexts - that's a very general term.
zz zZ Z Z #!perl