if ($opt{output}) {{
# derive format from file extension
- if ($opt{output} =~ /\.(yaml|txt)$/) {
+ if ($opt{output} =~ /\.(yaml|json|txt)$/) {
$opt{format} //= $1
}
else {
# output with user-preferred formatting
given ($opt{format}) {
+when ('json') {
+ require JSON;
+ say JSON->new->encode($data);
+}
when ('yaml') {
# full data in yaml (human-readable) formatting
require YAML;
All parsed data in YAML syntax.
+=item json
+
+Parsed data in JSON syntax.
+
=item pnm, png, bmp, ...
Image drawing of rendered levels.