So let me explain this error for you since it is pretty darn confusing, and then I have a few more suggestions.
Can't locate object method "blessed" via package "Can't locate object +method "update" via package "Class::MOP::Class::__ANON__::SERIAL::2" +at thread_test.pl line 115.
To start with, "Class::MOP::Class::__ANON__::SERIAL::2" is the name Moose/Class::MOP will give to an anon class. Exactly how or why this anon class was created I don't know, you will need to dig into the guts of Net::Twitter for that. I suspect it was runtime role composition, it is the most common usage of anon-classes.
So the next part is
Which is just saying that it cannot find the "update" method on that anon-class. Which I suspect is from your code right here:Can't locate object method "update" via package "Class::MOP::Class::__ +ANON__::SERIAL::2
which makes sense because we figured out earlier that %thread_hash is either not being shared properly or at the very least the value stored in the 'twit' key is not what you expect it to be.my $result = $thread_hash{'twit'}->update('Hello, world!');
This then brings us back to where we started ...
So here is looks like someone is attempting to call the "blessed" method on an error ($@). But that actually is not the case since I suspect this is actually caused by your code here:Can't locate object method "blessed" via package "Can't locate object +method "update" via package "Class::MOP::Class::__ANON__::SERIAL::2" +at thread_test.pl line 115.
and basically Perl is interpretting "blessed" as a method call since you have not actually imported the Scalar::Util::blessed method into your package. What makes this really confusing is that your error ($@) is actually a string ("Can't locate object method "update" via package "Class::MOP::Class::__ANON__::SERIAL::2") and since Perl classes are really just strings Perl is thinking that this string is a class name, when in fact it is just an error string.die $@ unless blessed $err && $err->isa('Net::Twitter::Error');
So, if we look at all that this, I would suggest you try a couple things.
In reply to Re^5: passing shared blessed object part 2
by stvn
in thread passing shared blessed object part 2
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |