use strict; use warnings; use JSON; use URI::Escape; my $json_string = JSON::to_json($perl_structure); print URI::Escape::uri_escape($json_string);