PerlIO::via::json - PerlIO layer to convert to and from JSON
use PerlIO::via::json; open my $fh, '<:via(json)', 'file.xml' or die "...: $!"; my $json = <$fh>; open my $fh, '>:via(json)', 'file.xml' or die "...: $!"; print $fh '{"key":"value"}';
This module implements a PerlIO layer that converts a file to or from JSON format.
In fact, it currently only supports converting between XML and JSON. Any suggestions?
Note: The XML<->JSON conversion relies on XML::XML2JSON. The XML file will be slurped and parsed all at once.
XML::XML2JSON
Scott Lanning <slanning@cpan.org>.
Ideas and/or code taken freely from other PerlIO::via modules, particularly those of Elizabeth Mattijsen (esp. PerlIO::via::QuotedPrint).
Copyright 2009,2017, Scott Lanning. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install PerlIO::via::json, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PerlIO::via::json
CPAN shell
perl -MCPAN -e shell install PerlIO::via::json
For more information on module installation, please visit the detailed CPAN module installation guide.