Subject: | Problem with JSON::Tiny v0.53 |
Date: | Thu, 28 May 2015 20:22:16 +0200 (CEST) |
To: | bug-Net-Graylog-Client [...] rt.cpan.org |
From: | pp140466 <pp140466 [...] orange.fr> |
Hi,
I was using Net::Graylog::Client v0.3 with no problem since a few month.
Today, I've set up a new server with the same app, I get this error message :
Can't locate object method "new" via package "JSON::Tiny" at /usr/local/share/perl/5.18.2/Net/Graylog/Client.pm line 149.
It seems that the only difference is JSON::Tiny wich was version 0.50 and now comes in version 0.53.
This change in Client.pm solve my problem but isn't fully tested
149 # my $json = JSON::Tiny->new();
150 # my $status = $self->_furl->post( $self->url, [ 'Content-Type' => ['application/json'] ], $json->encode( \%data ) );
my $status = $self->_furl->post( $self->url, [ 'Content-Type' => ['application/json'] ], JSON::Tiny->encode_json( \%data ) );
Config :
Ubuntu 14.04 : Linux ubse19 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
Perl 5 : perl 5, version 18, subversion 2 (v5.18.2) built for x86_64-linux-gnu-thread-multi