JSON stands for JavaScript Object Notation whose format you are looking for.
Unfortunately, none of the modules you are looking for are in the Perl core, but they are available in CPAN, as a quick search will show.
I would recommend setting JSON :: Any as a wrapper, as well as JSON :: XS (if you have a C compiler) or one of JSON and JSON :: Syck if you don't. JSON :: Any provides an interface class on top of several other JSON modules (you can choose or let choose from installed), which do not depend on which module you use. Thus, if your code needs to be ported elsewhere and, say, the target computer can install JSON :: XS when you cannot, you get a performance boost without any additional code.
use JSON::Any; my $j = JSON::Any->new; $json = $j->objToJson($perl_data);
Same.
source share