semifor / Net-Twitter

A Perl interface to the Twitter APIs
83 stars 37 forks source link

Code:Modification of a read-only value attempted at Net/Twitter/Core.pm line 233. #77

Open jordivador opened 7 years ago

jordivador commented 7 years ago

Hi, I'm getting this error Code:Modification of a read-only value attempted at Net/Twitter/Core.pm line 233. when I use decode_html_entities

I've tried using it as:

Net::Twitter->new(
        traits          => [qw/API::RESTv1_1 OAuth/],
        consumer_key    => core::Config->get('twitter')->{consumer_key},
        consumer_secret => core::Config->get('twitter')->{consumer_secret},
        ssl             => 1
    );

And:

$result = $self->api->_decode_html_entities($result)

In both cases the same error appears.

I'm using Net::Twitter version 4.01008 and Perl 5.14.2. I've checked the last version of lib and the code from decode_html_entities seems the same to me.

I'm not used with Moo itself and it's grammar but I wonder if the assignment of $_ to another value it's correct or not.

Thanks in advance.

semifor commented 7 years ago

The assignment to $_ is correct, provided $_ is modifiable, which is expected in that context. Can you show me the actual API call that results in the error?

If possible, please use Twitter::API instead of Net::Twitter. It's a complete replacement. I intend to deprecate Net::Twitter. It's mostly a drop in replacement. You use new_with_options instead of new, but otherwise, most code requires no other changes.

That may not resolve this problem. Something else seems amiss here. Seeing the actually API call may help me diagnose it further.