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

Re: require UNIVERSAL in Tk::Widget

Thread Next
From:
nick
Date:
October 6, 2003 07:43
Subject:
Re: require UNIVERSAL in Tk::Widget
Message ID:
20031006144301.2483.6@llama.elixent.com
Slaven Rezic <slaven@rezic.de> writes:
>Hello Nick,
>
>do you know if there's a reason for
>
>	require UNIVERSAL;
>
>in Tk/Widget.pm? 

There used to be - there are/were some calls to UNIVERAL::isa().
Perhaps that is now done in core?

>It seems that the explicit requirement breaks some
>things, especially:
>
>	perl -MTk -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.
>
>while
>
>	perl -Mless -e1
>
>does not fail with an error message. The root cause of the problem is
>that UNIVERSAL.pm sets import to Exporter::import, thus defining an
>explicit import function for *all* modules.

That sounds like a mis-feature that p5p should discuss.

>
>I would recommend to remove "require UNIVERSAL" from Tk/Widget.pm. In
>a quick test, the removal does not seem to be harmful.
>
>Regards,
>    Slaven


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About