Subject: | Attribute (sources) does not pass the type constraint because: Validation failed for 'XML::Feed::Aggregator::Sources' with value ARRAY(0x1b3dc88) |
Date: | Fri, 15 Feb 2013 01:26:03 -0500 |
To: | bug-XML-Feed-Aggregator [...] rt.cpan.org |
From: | John Musbach <johnmusbach1 [...] gmail.com> |
Distribution: XML::Feed::Aggregator (latest)
Perl: 5.10.1
Code: my @feeds = [ "
http://feeds.feedburner.com/Sportfiends?format=xml" ];
my $reader = XML::Feed::Aggregator->new({sources=>\@feeds});
my $curr_date;
my $heap=$_[HEAP];
my $ircbot=$heap->{irc};
while (1==1) {
if(!defined $curr_date) {
$reader->sort;
$reader->deduplicate;
for($reader->entries) {
my $tosay="$_->title: $_->content\n";
$ircbot->yield(privmsg=>"#weednews"=>$tosay);
}
$curr_date=DateTime->now;
}
else {
$reader->since($curr_date);
$reader->sort;
$reader->deduplicate;
for($reader->entries) {
my $tosay="$_->title: $_->content\n";
$ircbot->yield(privmsg=>"#weednews"=>$tosay);
}
$curr_date=DateTime->now;
}
}
This is being used with POE::Component::IRC. Seems like it should work but
it crashes with:
Attribute (sources) does not pass the type constraint because: Validation
failed for 'XML::Feed::Aggregator::Sources' with value ARRAY(0x1b3dc88) at
/usr/local/lib/perl/5.10.1/Moose/Meta/Attribute.pm line 1274.
Moose::Meta::Attribute::verify_against_type_constraint('Moose::Meta::Class::__ANON__::SERIAL::1=HASH(0x2b667f0)',
'ARRAY(0x1b3dc88)', 'instance', 'XML::Feed::Aggregator=HASH(0x2deb868)')
called at /usr/local/lib/perl/5.10.1/Moose/Meta/Attribute.pm line 1261
Moose::Meta::Attribute::_coerce_and_verify('Moose::Meta::Class::__ANON__::SERIAL::1=HASH(0x2b667f0)',
'ARRAY(0x1b3dc88)', 'XML::Feed::Aggregator=HASH(0x2deb868)') called at
/usr/local/lib/perl/5.10.1/Moose/Meta/Attribute.pm line 531
Moose::Meta::Attribute::initialize_instance_slot('Moose::Meta::Class::__ANON__::SERIAL::1=HASH(0x2b667f0)',
'Moose::Meta::Instance=HASH(0x2d5f680)',
'XML::Feed::Aggregator=HASH(0x2deb868)', 'HASH(0x2dcaa38)') called at
/usr/local/lib/perl/5.10.1/Class/MOP/Class.pm line 525
Class::MOP::Class::_construct_instance('Moose::Meta::Class=HASH(0x1939af8)',
'HASH(0x2dcaa38)') called at /usr/local/lib/perl/5.10.1/Class/MOP/Class.pm
line 498
Class::MOP::Class::new_object('Moose::Meta::Class=HASH(0x1939af8)',
'HASH(0x2dcaa38)') called at /usr/local/lib/perl/5.10.1/Moose/Meta/Class.pm
line 274
Moose::Meta::Class::new_object('Moose::Meta::Class=HASH(0x1939af8)',
'HASH(0x2dcaa38)') called at /usr/local/lib/perl/5.10.1/Moose/Object.pm
line 28
Moose::Object::new('XML::Feed::Aggregator', 'HASH(0x2dcab28)')
called at bot.pl line 36
main::irc_public('main', 'POE::Session=ARRAY(0x1b45ec0)',
'POE::Kernel=ARRAY(0x8884c8)', 'HASH(0x1b4e240)', 'irc_public',
'POE::Session=ARRAY(0x2d11188)', undef,
'/usr/local/share/perl/5.10.1/POE/Component/Syndicator.pm', 455,
'_syndicator_send_pending_events',
'D3M0N!D3M0N@\x{3}4NetStoner\x{f}.\x{3}2Legalize\x{3}7Our\x{3}9Marijuana\x{f}.\x{3}8us\x{f}',
'ARRAY(0x1b46b50)', 'moo :P') called at
/usr/local/share/perl/5.10.1/POE/Session.pm line 483
POE::Session::_invoke_state('POE::Session=ARRAY(0x1b45ec0)',
'POE::Session=ARRAY(0x2d11188)', 'irc_public', 'ARRAY(0x8fa2b0)',
'/usr/local/share/perl/5.10.1/POE/Component/Syndicator.pm', 455,
'_syndicator_send_pending_events') called at
/usr/local/share/perl/5.10.1/POE/Kernel.pm line 1036
eval {...} called at /usr/local/share/perl/5.10.1/POE/Kernel.pm
line 1022
POE::Kernel::_dispatch_event('POE::Kernel=ARRAY(0x8884c8)',
'POE::Session=ARRAY(0x1b45ec0)', 'POE::Session=ARRAY(0x1b45ec0)',
'irc_public', 2, 'ARRAY(0x8fa2b0)',
'/usr/local/share/perl/5.10.1/POE/Component/Syndicator.pm', 455,
'irc_public', 1360909032.05524, -1741) called at
/usr/local/share/perl/5.10.1/POE/Kernel.pm line 1738
POE::Kernel::call('POE::Kernel=ARRAY(0x8884c8)', 3, 'irc_public',
'D3M0N!D3M0N@\x{3}4NetStoner\x{f}.\x{3}2Legalize\x{3}7Our\x{3}9Marijuana\x{f}.\x{3}8us\x{f}',
'ARRAY(0x1b46b50)', 'moo :P') called at
/usr/local/share/perl/5.10.1/POE/Component/Syndicator.pm line 455
POE::Component::Syndicator::_syndicator_send_pending_events('POE::Component::IRC=HASH(0x620960)',
'POE::Session=ARRAY(0x2d11188)', 'POE::Kernel=ARRAY(0x8884c8)',
'POE::Component::IRC=HASH(0x620960)', '_syndicator_send_pending_events',
'POE::Session=ARRAY(0x2d11188)', undef,
'/usr/local/share/perl/5.10.1/POE/Component/Syndicator.pm', 214,
'POE::Wheel::ReadWrite(2) -> select read', 'irc_public',
'D3M0N!D3M0N@\x{3}4NetStoner\x{f}.\x{3}2Legalize\x{3}7Our\x{3}9Marijuana\x{f}.\x{3}8us\x{f}',
'ARRAY(0x1b46b50)', 'moo :P') called at
/usr/local/share/perl/5.10.1/POE/Session.pm line 483
POE::Session::_invoke_state('POE::Session=ARRAY(0x2d11188)',
'POE::Session=ARRAY(0x2d11188)', '_syndicator_send_pending_events',
'ARRAY(0x2df2be8)',
'/usr/local/share/perl/5.10.1/POE/Component/Syndicator.pm', 214,
'POE::Wheel::ReadWrite(2) -> select read') called at
/usr/local/share/perl/5.10.1/POE/Kernel.pm line 1049
eval {...} called at /usr/local/share/perl/5.10.1/POE/Kernel.pm
line 1048
POE::Kernel::_dispatch_event('POE::Kernel=ARRAY(0x8884c8)',
'POE::Session=ARRAY(0x2d11188)', 'POE::Session=ARRAY(0x2d11188)',
'_syndicator_send_pending_events', 1, 'ARRAY(0x2df2be8)',
'/usr/local/share/perl/5.10.1/POE/Component/Syndicator.pm', 214,
'POE::Wheel::ReadWrite(2) -> select read', 1360909032.0538, 198) called at
/usr/local/share/perl/5.10.1/POE/Resource/Events.pm line 315
POE::Kernel::_data_ev_dispatch_due('POE::Kernel=ARRAY(0x8884c8)')
called at /usr/local/share/perl/5.10.1/POE/Loop/Select.pm line 309
POE::Kernel::loop_do_timeslice('POE::Kernel=ARRAY(0x8884c8)')
called at /usr/local/share/perl/5.10.1/POE/Loop/Select.pm line 317
POE::Kernel::loop_run('POE::Kernel=ARRAY(0x8884c8)') called at
/usr/local/share/perl/5.10.1/POE/Kernel.pm line 1235
POE::Kernel::run('POE::Kernel=ARRAY(0x8884c8)') called at
bot.plline 21
--
Best Regards,
John Musbach