Subject: | Remove 'UNIVERSAL->import is deprecated' warning |
Perl 5.12 and later warn when the isa, can or VERSION functions are
imported from UNIVERSAL. This is because these functions are deprecated
and will be removed in a later version of Perl. This patch uses reftype
(from Scalar::Utils) in place of isa, as suggested by the documentation
for UNIVERSAL (http://search.cpan.org/~rjbs/perl-5.12.3/lib/UNIVERSAL.pm).
Perl: v5.12.3 built for x86_64-linux-thread-multi
Cheers
-Tom
Subject: | Tie-Hash-Sorted-reftype.patch |
Only in Tie-Hash-Sorted-0.10-reftype: Makefile.old
diff -crB Tie-Hash-Sorted-0.10/Makefile.PL Tie-Hash-Sorted-0.10-reftype/Makefile.PL
*** Tie-Hash-Sorted-0.10/Makefile.PL 2011-03-12 12:40:18.384047072 +1000
--- Tie-Hash-Sorted-0.10-reftype/Makefile.PL 2011-03-12 12:39:44.430716904 +1000
***************
*** 4,12 ****
'NAME' => 'Tie::Hash::Sorted',
'VERSION_FROM' => 'Sorted.pm',
'PREREQ_PM' => {
! Carp => 0,
! strict => 0,
! vars => 0,
! UNIVERSAL => 0
}
);
--- 4,13 ----
'NAME' => 'Tie::Hash::Sorted',
'VERSION_FROM' => 'Sorted.pm',
'PREREQ_PM' => {
! 'Carp' => 0,
! 'strict' => 0,
! 'vars' => 0,
! 'UNIVERSAL' => 0,
! 'Scalar::Util' => 0,
}
);
diff -crB Tie-Hash-Sorted-0.10/Sorted.pm Tie-Hash-Sorted-0.10-reftype/Sorted.pm
*** Tie-Hash-Sorted-0.10/Sorted.pm 2003-09-12 06:19:17.000000000 +1000
--- Tie-Hash-Sorted-0.10-reftype/Sorted.pm 2011-03-12 12:36:16.270737769 +1000
***************
*** 3,9 ****
use strict;
use Carp;
use vars '$VERSION';
! use UNIVERSAL 'isa';
use constant FIRST_KEY => -1;
use constant STORED_HASH => 0;
--- 3,9 ----
use strict;
use Carp;
use vars '$VERSION';
! use Scalar::Util qw(reftype);
use constant FIRST_KEY => -1;
use constant STORED_HASH => 0;
***************
*** 72,78 ****
sub Sort_Routine {
my ($self, $sort) = @_;
! croak "Not a code ref" if ! isa($sort, 'CODE');
$self->[SORT_ROUTINE] = $sort;
$self->[CHANGED] = 1;
return;
--- 72,78 ----
sub Sort_Routine {
my ($self, $sort) = @_;
! croak "Not a code ref" if (reftype($sort) || '') ne 'CODE';
$self->[SORT_ROUTINE] = $sort;
$self->[CHANGED] = 1;
return;
***************
*** 109,115 ****
$self->Optimization($opt{Optimization});
my $hash = $opt{Hash} || {};
! croak "$hash is not a hash ref" if ! isa($hash, 'HASH');
@{$self->[STORED_HASH]}{keys %$hash} = values %$hash;
$self->[STORE_ROUTINE] = {
--- 109,115 ----
$self->Optimization($opt{Optimization});
my $hash = $opt{Hash} || {};
! croak "$hash is not a hash ref" if (reftype($hash) || '') ne 'HASH';
@{$self->[STORED_HASH]}{keys %$hash} = values %$hash;
$self->[STORE_ROUTINE] = {