#! /usr/bin/perl use strict; use JSON; # https://metacpan.org/pod/JSON # sudo cpanm JSON ## from json to hash my $json = <{'name'}\n"; print "AGE: $obj->{'age'}\n"; ## from hash to json my %person = ('name'=>'Steve', 'age'=>34); my $text = &encode_json(\%person); # pass a reference to a hash print "JSON TEXT: $text\n";