$json_text = to_json($perl_scalar) Converts the given Perl data structure to a json string.