Skip Menu |

This queue is for tickets about the Data-Constraint CPAN distribution.

Report information
The Basics
Id: 98151
Status: resolved
Priority: 0/
Queue: Data-Constraint

People
Owner: Nobody in particular
Requestors: fraserbn [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: [PATCH] Silence warnings in 5.21 about using UNIVERSAL->import
Subject: 0001-Silence-warnings-in-5.21-about-using-UNIVERSAL-impor.patch
From 0f7a111546c2bcea97f5947fd6b1896d12c96b41 Mon Sep 17 00:00:00 2001 From: Brian Fraser <fraserbn@gmail.com> Date: Mon, 18 Aug 2014 21:59:01 +0200 Subject: [PATCH] Silence warnings in 5.21 about using UNIVERSAL->import This is deprecated and will be removed in future perls, so just use UNIVERSAL::isa() without explicitly importing anything. --- t/add_constraint.t | 3 +-- t/delete.t | 1 - t/get_by_name.t | 3 +-- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/t/add_constraint.t b/t/add_constraint.t index a71cab5..330a674 100644 --- a/t/add_constraint.t +++ b/t/add_constraint.t @@ -2,7 +2,6 @@ use strict; use Test::More tests => 6; -use UNIVERSAL qw(isa); use Data::Constraint; @@ -14,7 +13,7 @@ my $class = 'Data::Constraint'; my $constraint = $class->get_by_name( 'fake' ); # no such thing ok( ! defined $constraint, 'Non-existent constraint returns undef' ); -ok( ! isa( $constraint, $class ), +ok( ! UNIVERSAL::isa( $constraint, $class ), 'Non-existent constraint is not an object' ); } diff --git a/t/delete.t b/t/delete.t index 8bcf856..26a15c0 100644 --- a/t/delete.t +++ b/t/delete.t @@ -2,7 +2,6 @@ use strict; use Test::More tests => 6; -use UNIVERSAL qw(isa); use Data::Constraint; diff --git a/t/get_by_name.t b/t/get_by_name.t index acc087a..f51b892 100644 --- a/t/get_by_name.t +++ b/t/get_by_name.t @@ -2,7 +2,6 @@ use strict; use Test::More tests => 6; -use UNIVERSAL qw(isa); use Data::Constraint; @@ -30,5 +29,5 @@ can_ok( $constraint, qw(run description check) ); my $constraint = $class->get_by_name( 'fake' ); # no such thing ok( ! defined $constraint, 'Non-existent constraint returns undef' ); -ok( ! isa( $constraint, 'Data::Constraint' ) ); +ok( ! UNIVERSAL::isa( $constraint, 'Data::Constraint' ) ); } \ No newline at end of file -- 1.7.12.4 (Apple Git-37)
On 2014-08-18 12:52:20, Hugmeir wrote: Show quoted text
> +ok( ! UNIVERSAL::isa( $constraint, $class ), > +ok( ! UNIVERSAL::isa( $constraint, 'Data::Constraint' ) );
Those should be: ok(!$constraint->isa, $class) and ok(!$constraint->isa('Data::Constraint') -- isa should only ever be called as a method, not a function directly in UNIVERSAL. (Calling as a function is deprecated -- classes are meant to be able to override the functionality that comes from UNIVERSAL.)
From: fraserbn [...] gmail.com
On Mon Aug 18 17:48:48 2014, ETHER wrote: Show quoted text
> On 2014-08-18 12:52:20, Hugmeir wrote: >
> > +ok( ! UNIVERSAL::isa( $constraint, $class ), > > +ok( ! UNIVERSAL::isa( $constraint, 'Data::Constraint' ) );
> > > Those should be: ok(!$constraint->isa, $class) and ok(!$constraint-
> >isa('Data::Constraint') -- isa should only ever be called as a
> method, not a function directly in UNIVERSAL. (Calling as a function > is deprecated -- classes are meant to be able to override the > functionality that comes from UNIVERSAL.)
Agreed, but the test was using it in function form, so I left it that way. Maybe $constraint can be undef here?
Fixed in 1.17, although with many other updates and facelifts.