Re:Perl 5.26.0 released
by yellowapple on Sunday June 04, 2017 @12:53AM
(#14479941)
Blessed anything, really. One could bless a scalar or array if one so chooses (not that I would recommend doing so, but whatever).
But yeah. Perl 5's flavor of object-orientation is remarkable for exposing the inner workings of objects to the programmer. Fields are just hash table items. Methods are just subs that take the object as the first parameter. Classes are just namespaces/modules full of methods and constructors. Constructors are just ordinary subs that return blessed data structures.
It's all remarkably simple and elegant once you're used to it.
But yeah. Perl 5's flavor of object-orientation is remarkable for exposing the inner workings of objects to the programmer. Fields are just hash table items. Methods are just subs that take the object as the first parameter. Classes are just namespaces/modules full of methods and constructors. Constructors are just ordinary subs that return blessed data structures.
It's all remarkably simple and elegant once you're used to it.