;
package Data::Section::Pluggable::Plugin::Json 0.08 {
# ABSTRACT: Data::Section::Pluggable Plugin for JSON
use Role::Tiny::With;
use JSON::MaybeXS ();
with 'Data::Section::Plugg
return ('json');
}
sub process_content ($class, $dsp, $content) {
JSON::MaybeXS::decode_json($content);
}
sub format_content ($class, $dsw, $content) {
JSON::MaybeXS
END__
=pod
=encoding UTF-8
=head1 NAME
Data::Section::Pluggable::Plugin::Json - Data::Section::Pluggable Plugin for JSON
=head1 VERSION
version 0.08
=head1 SYNOPSIS
use Data::Section::Pluggab
('json');
# prints "Welcome to Perl" without prefix
# or trailing white space.
say $dsp->get_data_section('hello.txt');
# also prints "Welcome to Perl"
say $dsp->get_data_section('hello.json'
$dsp->get_data_section('hello.bin');
__DATA__
@@ hello.txt
Welcome to Perl
@@ hello.json
{"message":"Welcome to Perl"}
@@ hello.bin (base64)
VGhpcyBpcyBiYXNlNjQgZW5jb2RlZC4K
=head1
xtension. The extension should be a filename
extension without the C<.>, for example C<txt> or C<json>.
The callback takes the L<Data::Section::Pluggable> instance as its first argument and the cont