use warnings; use strict; use feature qw{ say }; use JSON::PP; my $j = JSON::PP->new->canonical; say $j->encode({abc => 12, def => 13});