use strict; use Readonly; use CGI; use Data::Dumper; use JSON; #use cgi.pm to get json as input my $q = CGI->new; my $jsonText = $q->param('inputdata'); my $json = JSON->new->utf8->allow_nonref(1); my $outputDataRef = $json->decode($jsonText); print qq{Content-type: application/json; charset=utf8\n\n}; my $outputData = $json->encode($outputDataRef); print $outputData;