use JSON; my $json_text = to_json(\%UDIoutput); print $json_text;