Miskatonic University Press

yaml2json

code

A Google search for yaml2json got fewer results than I'd expected, but had an answer, and convert yaml to json led me to another Perl one-liner I note here for reference:

perl -MYAML=Load -MJSON::Any -E 'say JSON::Any->new->Dump(Load(do { local $/; <> }))'

I needed the JSON::Any Perl module, which is libjson-any-perl in Synaptic on Ubuntu. Is it just me or is it hard to find things in Synaptic? How would I search for "json AND perl"? Anyway, searching for "json" and scrolling turned it up.