develooper Front page | perl.perl5.porters | Postings from October 2003

require UNIVERSAL;

Thread Next
Slaven Rezic
October 6, 2003 08:16
require UNIVERSAL;
Message ID:
The explicit usage/requirement of seems to break things:

$ perl -Mless=time -e1
(no errors)

$ perl -MUNIVERSAL -Mless=time -e1
"time" is not exported by the less module
Can't continue after import errors at -e line 0
BEGIN failed--compilation aborted.

I see the following comment and code in

# UNIVERSAL should not contain any extra subs/methods beyond those
# that it exists to define. The use of Exporter below is a historical
# accident that can't be fixed without breaking code.  Note that we
# *don't* set @ISA here, don't want all classes/objects inheriting from
# Exporter.  It's bad enough that all classes have a import() method
# whenever is loaded.
require Exporter;
*import = \&Exporter::import;

Can anybody remember the requirement for defining the import alias?
Can it be removed? If not, then the documentation of should
be changed and it should say in big letters to not use or require


Slaven Rezic - slaven <at> rezic <dot> de

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About