use strict;
my $JSON;
for ( qw/JSON::MaybeXS JSON JSON::PP/ ) {
last if $JSON = eval "use $_; '$_'";
}
$JSON or die <<'...';
ERROR: No JSON Perl modules are installed.
This Perl program is being
b' command. It requires
one of the 'JSON::MaybeXS', 'JSON' or 'JSON::PP' Perl modules, but it seems
that you have none of these installed.
Please install the 'JSON::MaybeXS' module from CPAN, and try
again.
...
{
my $data = decode_json(do {local $/; <>});
die "Unknown JSON result" unless
ref($data) =~ /^(HASH|ARRAY)$/;
walk($data, '');
};
sub walk {
my ($node, $path) = @_;
if (re