ETL::Yertl::Format - Base class for input/output formats
version 0.043
use ETL::Yertl::Format; my $json_format = ETL::Yertl::Format->get( "json" ); my $default_format = ETL::Yertl::Format->get_default;
Formatters handle parsing input strings into document hashes and formatting document hashes into output strings.
Formatter objects are given to ETL::Yertl::FormatStream objects.
my $format = ETL::Yertl::Format->get( $name, %args );
Get the formatter with the given name. $name should be the last word in the ETL::Yertl::Format subclass (like yaml for ETL::Yertl::Format::yaml). %args will be passed-in to the formatter constructor.
$name
ETL::Yertl::Format
yaml
ETL::Yertl::Format::yaml
%args
my $format = ETL::Yertl::Format->get_default;
Get the default format for Yertl programs to communicate with each other. By default, this is YAML, but it can be set to JSON by setting the YERTL_FORMAT environment variable to "json".
YAML
JSON
YERTL_FORMAT
"json"
Setting the default format to something besides YAML can help interoperate with other programs like jq or recs.
ETL::Yertl::FormatStream
Doug Bell <preaction@cpan.org>
This software is copyright (c) 2018 by Doug Bell.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install ETL::Yertl, copy and paste the appropriate command in to your terminal.
cpanm
cpanm ETL::Yertl
CPAN shell
perl -MCPAN -e shell install ETL::Yertl
For more information on module installation, please visit the detailed CPAN module installation guide.