Subject: | incorrect usage of UNIVERSAL::isa as a function |
YAML::AppConfig uses UNIVERSAL::isa as function, whereas it is supposed
to be a method. Moreover, importing it explicitely triggers a warning:
UNIVERSAL->import is deprecated and will be removed in a future perl at
/usr/lib/perl5/vendor_perl/5.12.2/YAML/AppConfig.pm line 5
Last but not least, its usage is absolutly useless, ref can be used
directly, as demonstrated by the attached patch.
Subject: | YAML-AppConfig-0.16-fix-warning.patch |
diff -Naur -x '*~' YAML-AppConfig-0.16/lib/YAML/AppConfig.pm YAML-AppConfig-0.16-fix-warning/lib/YAML/AppConfig.pm
--- YAML-AppConfig-0.16/lib/YAML/AppConfig.pm 2006-07-09 09:34:56.000000000 +0200
+++ YAML-AppConfig-0.16-fix-warning/lib/YAML/AppConfig.pm 2011-02-07 20:36:26.000000000 +0100
@@ -2,7 +2,6 @@
use strict;
use warnings;
use Carp;
-use UNIVERSAL qw(isa);
use Storable qw(dclone); # For Deep Copy
####################
@@ -113,7 +112,7 @@
if ( not ref $value ) {
$value = $self->_resolve_scalar($value);
}
- elsif ( isa $value, 'HASH' ) {
+ elsif (ref $value eq 'HASH' ) {
$value = dclone($value);
my @hidden = $self->_push_scope($value);
for my $key ( keys %$value ) {
@@ -122,13 +121,13 @@
$self->_pop_scope(@hidden);
return $value;
}
- elsif ( isa $value, 'ARRAY' ) {
+ elsif (ref $value eq 'ARRAY' ) {
$value = dclone($value);
for my $item (@$value) {
$item = $self->_resolve_refs( $item );
}
}
- elsif ( isa $value, 'SCALAR' ) {
+ elsif (ref $value eq 'SCALAR' ) {
$value = $self->_resolve_scalar($$value);
}
else {