12 $ARGV[0] =~ s/^--// or last; # --flag
13 my ($name, $val) = split /=/, shift, 2 or last; # set until empty
14 $get{$name} = $val // 1;
16 my $file = shift or die "Usage: $0 [--options] <input>\n";
18 my $jsonify = JSON->new->utf8->canonical;
19 $jsonify->pretty if $get{pretty};
21 my $data = do "./$file" or die $@;
22 print $jsonify->encode($data)
23 =~ s{\[ \K\n ([^][]+) (?=\])}{$1 =~ s/(?:\A|\n) \s*//gr}reg;