From: M.J.T. Guy Date: Thu, 10 Apr 1997 08:55:05 +0000 (+1200) Subject: Remove 'use UNIVERSAL;', switch to UNIVERSAL::isa() X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d704f39a0db2dc23790dfd9d7bd59ce9928a6e2c;p=p5sagit%2Fp5-mst-13.2.git Remove 'use UNIVERSAL;', switch to UNIVERSAL::isa() Subject: Re: UNIVERSAL.pm and import methods I wrote > I've a sneaking feeling that I'm the only person who's tried to use > this. And as you might guess from my bug reports, I've learnt the > error of my ways. I spoke too soon. There are three uses in the standard distribution. The attached patch should get rid of them. Probably worth doing this irrespective of how the UNIVERSAL/import question is resolved. p5p-msgid: E0whaZJ-0007BA-00@ursa.cus.cam.ac.uk --- diff --git a/lib/Class/Struct.pm b/lib/Class/Struct.pm index eca2c6c..09ab196 100644 --- a/lib/Class/Struct.pm +++ b/lib/Class/Struct.pm @@ -146,9 +146,6 @@ sub struct { # Create accessor methods. - if ( $got_class && $CHECK_CLASS_MEMBERSHIP ) { - $out .= " use UNIVERSAL;\n"; - } my( $pre, $pst, $sel ); $cnt = 0; foreach $name (@methods){ diff --git a/lib/File/Compare.pm b/lib/File/Compare.pm index a76eb1f..2f9c45c 100644 --- a/lib/File/Compare.pm +++ b/lib/File/Compare.pm @@ -5,7 +5,6 @@ use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $Too_Big *FROM *TO); require Exporter; use Carp; -use UNIVERSAL qw(isa); $VERSION = '1.1001'; @ISA = qw(Exporter); @@ -34,7 +33,8 @@ sub compare { croak("from undefined") unless (defined $from); croak("to undefined") unless (defined $to); - if (ref($from) && (isa($from,'GLOB') || isa($from,'IO::Handle'))) { + if (ref($from) && + (UNIVERSAL::isa($from,'GLOB') || UNIVERSAL::isa($from,'IO::Handle'))) { *FROM = *$from; } elsif (ref(\$from) eq 'GLOB') { *FROM = $from; @@ -45,7 +45,8 @@ sub compare { $fromsize = -s FROM; } - if (ref($to) && (isa($to,'GLOB') || isa($to,'IO::Handle'))) { + if (ref($to) && + (UNIVERSAL::isa($to,'GLOB') || UNIVERSAL::isa($to,'IO::Handle'))) { *TO = *$to; } elsif (ref(\$to) eq 'GLOB') { *TO = $to; diff --git a/lib/File/Copy.pm b/lib/File/Copy.pm index b1baa20..e95168e 100644 --- a/lib/File/Copy.pm +++ b/lib/File/Copy.pm @@ -9,7 +9,6 @@ package File::Copy; use strict; use Carp; -use UNIVERSAL qw(isa); use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION $Too_Big © &syscopy &cp &mv); @@ -48,11 +47,13 @@ sub copy { my $from_a_handle = (ref($from) ? (ref($from) eq 'GLOB' - || isa($from, 'GLOB') || isa($from, 'IO::Handle')) + || UNIVERSAL::isa($from, 'GLOB') + || UNIVERSAL::isa($from, 'IO::Handle')) : (ref(\$from) eq 'GLOB')); my $to_a_handle = (ref($to) ? (ref($to) eq 'GLOB' - || isa($to, 'GLOB') || isa($to, 'IO::Handle')) + || UNIVERSAL::isa($to, 'GLOB') + || UNIVERSAL::isa($to, 'IO::Handle')) : (ref(\$to) eq 'GLOB')); if (!$from_a_handle && !$to_a_handle && -d $to && ! -d $from) {