Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 31 lines (22 sloc) 475 Bytes
#!/usr/bin/perl
use strict;
use JSON::PP;
my $path = shift(@ARGV);
my $raw = 0;
if ($path eq "--raw") {
$raw = 1;
$path = shift(@ARGV);
}
my @lines = (<>);
my $hash = decode_json(join('', @lines));
if ($path) {
for my $key (split(/\//, $path)) {
$hash = $hash->{$key};
}
}
$hash = $hash + 0 if !ref($hash) && $hash eq ($hash + 0);
if ($raw && !ref($hash)) {
print $hash;
} else {
print JSON::PP->new->allow_nonref->canonical->pretty->encode($hash);
}
Something went wrong with that request. Please try again.