Subject: | Warnings with Class::MOP(0.80_01 or later) |
As subject, I got a warning
The compute_all_applicable_attributes method has been deprecated. Use
get_all_attributes instead.
at
/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Class/MOP/Class.pm line
929
Class::MOP::Class::compute_all_applicable_attributes('Class::MOP::Class::__ANON__::SERIAL::41=HASH(0x9b32418)')
called at /usr/lib/perl5/site_perl/5.8.8/Data/Visitor/Callback.pm line 42
Data::Visitor::Callback::BUILDARGS('Data::Visitor::Callback')
called at generated method (unknown origin) line 4
Data::Visitor::Callback::new('Data::Visitor::Callback') called
at ./data_visitor_callback.pl line 10
main::main() called at ./data_visitor_callback.pl line 6
The reason is simple.
You know, Class::MOP::compute_all_applicable_attributes is deprecated,
but it is called in Data::Visitor::Callback::BUIDLARGS.
I attach the patch(you might not need).
Thank you.
Subject: | Callback.pm.patch |
--- Callback.pm 2009-04-08 21:39:57.000000000 +0900
+++ Callback.pm.new 2009-04-08 21:49:31.000000000 +0900
@@ -39,7 +39,7 @@
my $args = $class->SUPER::BUILDARGS(@args);
- my %init_args = map { $_->init_arg => undef } $class->meta->compute_all_applicable_attributes;
+ my %init_args = map { $_->init_arg => undef } $class->meta->get_all_attributes;
my %callbacks = map { $_ => $args->{$_} } grep { not exists $init_args{$_} } keys %$args;