Can't run Perl script on other computer -
when try run script on second computer message:
malformed json string, neither array, object, number, string or atom, @ character offset 0 (before "lwp support htt...") @ iptest.pl line 21, line 2.
on first computer, script works fine.
line 21:
my $data = decode_json($resp->content); does know problem can be?
thanks in advance
i'm bit surprised json error error get. contain tiny little hint: "lwp support htt...". bet lwp missing module needs able make https connections. have 2 options:
- print
$response->contentsee full error message. - on command line,
lwp-request https://google.com/. should see full error message.
then install missing module.
and of course: please, please, please:
use strict,use warnings- clean script , throw away every
use-line don't need: io::socket, lwp::simple, yaml::tiny. - read documentation of modules using. trying achieve
lwp::useragent->new(keep_alive)? hint: won't quotekeep_alive.
Comments
Post a Comment