p5-Data-Printer-Filter-JSON
文件大小: unknow
源码售价: 5 个金币 积分规则     积分充值
资源说明:Data::Printer::Filter::JSON
=head1 NAME

Data::Printer::Filter::JSON - pretty-print your decoded JSON structures!

=head1 VERSION

Version 0.03

=head1 SYNOPSIS

# In your program:

    use Data::Printer filters => {
        -external => [ 'JSON' ],
    };

# or, in your C<.dataprinter> file:

    {
        filters => {
            -external => [ 'JSON' ],
        },
    };

# You can also tweak the colors:

    use Data::Printer {
        filters => {
            -external   => [ 'JSON' ],
        }, color => {
            JSON  => {
              true  => 'bright_blue on_black',
              false => 'black on_bright_blue'
            }
        },
    };

=head1 DESCRIPTION

Almost every JSON decoder on CPAN handles JavaScript's booleans with objects, and some
even reuse them in the resulting data structure. The result? A tiny JSON like this:

    {
      "alpha": true,
      "beta" : false,
      "gamma": true,
      "zeta" : false
    }

Results in this Data::Printer output:

    \ {
        alpha   JSON::XS::Boolean  {
            Parents       JSON::Boolean
            public methods (0)
            private methods (1) : __ANON__
            internals: 1
        },
        beta    JSON::XS::Boolean  {
            Parents       JSON::Boolean
            public methods (0)
            private methods (1) : __ANON__
            internals: 0
        },
        gamma   var{alpha},
        zeta    var{beta}
    }

While all I wanted was this:

    \ {
        alpha   true,
        beta    false,
        gamma   true,
        zeta    false
    }

This module fixes that! :)

=head2 Handles

L and L (L 2.x), L (L 1.x),
L, L, L, L, L (used by
L) and L.

=head3 JSON::JOM Caveat

When working with L, make sure you load it B loading L.
This is L's working on it!|https://github.com/garu/Data-Printer/issues/33>.

=head2 Can't Handle

The output of any JSON decoder that does NOT use a blessed reference for its
booleans, like L or L.

=head1 AUTHOR

Nuba Princigalli 

=head1 CONTRIBUTORS

Tim Heaney 

=head1 COPYRIGHT AND LICENSE

Copyright (c) 2012, Nuba Princigalli . All rights reserved.

This is free software; you can redistribute it and/or modify it under the same
terms as the Perl 5 programming language system itself.


本源码包内暂不包含可直接显示的源代码文件,请下载源码包。