Subject: | prototype mismatch warnings (w/patch) |
Under 5.10, Data::Visitor gets a prototype mismatch warning due to the
conflict between
use Scalar::Util qw/blessed refaddr reftype weaken isweak/;
and
# currently broken
has weaken => (
isa => "Bool",
is => "rw",
default => 0,
);
This could also be the reason that it's currently broken, as someone
noted in the source. A patch for one possible solution is attached,
although you might prefer to simply rename the attribute...
--
www.jasonkohles.com
Subject: | Data-Visitor-weaken.patch |
--- /usr/local/lib/perl5/site_perl/5.10.0/Data/Visitor.pm 2009-01-26 14:50:18.000000000 -0500
+++ Visitor.pm 2009-01-26 14:48:39.000000000 -0500
@@ -3,7 +3,7 @@
package Data::Visitor;
use Squirrel;
-use Scalar::Util qw/blessed refaddr reftype weaken isweak/;
+use Scalar::Util qw/blessed refaddr reftype isweak/; # weaken
use overload ();
use Symbol ();
@@ -423,7 +423,7 @@
foreach my $value ( Data::Alias::deref($new) ) {
if ( ref $value and $targets{refaddr($value)}) {
push @{ $seen_hash->{weakened} ||= [] }, $value; # keep a ref around
- weaken($value);
+ Scalar::Util::weaken($value);
}
}
}