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:

  1. print $response->content see full error message.
  2. 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 quote keep_alive.

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -