in reply to Re^2: OO systems and Perl 5 (Was: Recap: Future of Perl 5)
in thread OO systems and Perl 5 (Was: Recap: Future of Perl 5)
UNIVERSAL.pm itself is not so important. It's mostly just documentation. The guts of the UNIVERSAL package (UNIVERSAL::can, UNIVERSAL::isa, UNIVERSAL::DOES) are hard-coded into Perl, not part of a module.
The disadvantage of having UNIVERSAL::new is that all packages automatically inherit from UNIVERSAL; even ones not designed to be used as classes. How much sense do things like this make?
use strict; my $thing = strict->new;
A whole lot of modules would need to add code like this to them:
sub new { # override UNIVERSAL::new require Carp; Carp::croak("$_[0] is not a class"); }
In Section
Meditations