The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

yaml2json.pl : convert YAML to JSON with formatting options

VERSION

Version 0.02

SYNOPSIS

    yaml2json.pl -i "input.yaml" -o "output.json" --escape-unicode --pretty

USAGE

yaml2json.pl

Options:

--i filename : specify a filename which contains a YAML data structure.
--I "string" : specify a string which contains a YAML data structure.
--o outputfilename : specify the output filename to write the result to, which will be JSON.
--escape-unicode : it will escape all unicode characters, and convert them to something like "\u0386"
--pretty : write this JSON pretty, line breaks, indendations, "the full catastrophe"

Input can be read from an input file (--i), from a string at the command line (--I) (properly quoted!), from STDIN (which also includes a file redirection yaml2json.pl < inputfile.yaml > outputfile.json

For more information see Data::Roundtrip.

AUTHOR

Andreas Hadjiprocopis, <bliako at cpan.org> / <andreashad2 at gmail.com>