JSON cannot store "arbitrary structures". Not unless your definition of "arbitrary" is extremely limited. It can't contain cyclic references for example. Something like this can be represented in Perl code, Storable, YAML, and (using IDREF) probably in XML, but not JSON…
use strict;
use warnings;
use Data::Dumper qw(Dumper);
use YAML::XS qw(Dump);
my $data = do {
my $child = {};
my $parent = { child => $child };
$child->{parent} = $parent;
};
print "#### Perl ####\n";
print Dumper($data), "\n";
print "#### YAML ####\n";
print Dump($data), "\n";