Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Net-Twitter CPAN distribution.

Report information
The Basics
Id: 55283
Status: resolved
Priority: 0/
Queue: Net-Twitter

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

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



Subject: Net::Twitter::Error fails with Can't locate object method "blessed" via package "Net::Twitter::Error"
I think this is because I have updated my version of Moose: Moose Changes 0.93_01 Mon, Jan 4, 201 "The unimport subs created by Moose::Exporter now clean up re-exported functions like blessed and confess, unless the caller imported them from somewhere else too. See Moose::Manua::Delta for backcompat details. (rafl)" and Net::Twitter::Error does not import blessed. So I guess previously it was silently inheriting it. Attached script (test.pl) reproduces the error. A possible workaround is to add use Scalar::Util qw/blessed/; to your script.
Subject: test.pl
#!/usr/bin/perl use strict; use warnings; use Moose 0.93_01; use Net::Twitter; # use Scalar::Util qw/blessed/; my $nt = Net::Twitter->new( traits => [qw/API::REST/], username => 'homer', password => 'doh!', ); eval { my $statuses = $nt->friends_timeline(); # will fail cos of authentication }; if ($@) { if ( blessed $@ && $@->isa('Net::Twitter::Error') ) { warn "Net::Twitter::Error - $@->error"; } else { warn "NOT a Net::Twitter::Error - $@"; } }
On Sat Mar 06 09:55:42 2010, piroghi wrote: Show quoted text
> I think this is because I have updated my version of Moose: > > Moose Changes 0.93_01 Mon, Jan 4, 201 "The unimport subs created by > Moose::Exporter now clean up re-exported functions like blessed and > confess, unless the caller imported them from somewhere else too. See > Moose::Manua::Delta for backcompat details. (rafl)" > > and Net::Twitter::Error does not import blessed. So I guess previously > it was silently inheriting it. > > Attached script (test.pl) reproduces the error. > > A possible workaround is to add > use Scalar::Util qw/blessed/; > to your script.
I don't think this is a Net::Twitter bug. Net::Twitter imports blessed where ever it is used internally. I will add "use Scalar::Util 'blessed'" to the Net::Twitter POD Synopsis to make it more clear that calling code needs to import blessed to use it. But unless I'm missing something, it's the calling code that's broken, not Net::Twitter.
From: piroghi.rattoons [...] gmail.com
On Sat Mar 06 12:31:16 2010, MMIMS wrote: Show quoted text
> On Sat Mar 06 09:55:42 2010, piroghi wrote:
> > I think this is because I have updated my version of Moose: > > > > Moose Changes 0.93_01 Mon, Jan 4, 201 "The unimport subs created by > > Moose::Exporter now clean up re-exported functions like blessed and > > confess, unless the caller imported them from somewhere else too. See > > Moose::Manua::Delta for backcompat details. (rafl)" > > > > and Net::Twitter::Error does not import blessed. So I guess previously > > it was silently inheriting it. > > > > Attached script (test.pl) reproduces the error. > > > > A possible workaround is to add > > use Scalar::Util qw/blessed/; > > to your script.
> > I don't think this is a Net::Twitter bug. Net::Twitter imports blessed > where ever it is used internally. I will add "use Scalar::Util > 'blessed'" to the Net::Twitter POD Synopsis to make it more clear that > calling code needs to import blessed to use it. > > But unless I'm missing something, it's the calling code that's broken, > not Net::Twitter.
Sorry. My bad (it's been a long day). You are completely right.
Finally getting around to marking this one closed. Thanks for posting!