Help for this page
var leg = { aa: "a label", ... ["R6", "c", "1", "CB16", "CB15" ... codes that are listed in map], ... ];
use JSON; use Data::Dump "dd"; ... } END my $leg = decode_json($leg_str);
use WWW::Mechanize::PhantomJS; my $js = WWW::Mechanize::PhantomJS->new(); $js->get_local("my_js_file.js"); #print $js->content; I get the content ok here. my ($val, $type) = $js->eval_in_page('function(){JSON.stringify(leg);} +');