<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME
    Error::Pure::Output::JSON - Output JSON subroutines for Error::Pure.

SYNOPSIS
     use Error::Pure::Output::JSON qw(err_json);
     print err_json(@errors);

SUBROUTINES
    "err_json(@errors)"
             JSON print of backtrace.
             When is set global variable $PRETTY, print pretty output.
             Returns JSON serialization of backtrace.

VARIABLES
    $PRETTY
             JSON pretty output flag. Possible values are 0 or 1.
             Default value is 0.

EXAMPLE1
     # Pragmas.
     use strict;
     use warnings;

     # Modules.
     use Error::Pure::Output::JSON qw(err_json);

     # Fictional error structure.
     my $err_hr = {
             'msg' =&gt; [
                     'FOO',
                     'KEY',
                     'VALUE',
             ],
             'stack' =&gt; [
                     {
                             'args' =&gt; '(2)',
                             'class' =&gt; 'main',
                             'line' =&gt; 1,
                             'prog' =&gt; 'script.pl',
                             'sub' =&gt; 'err',
                     }, {
                             'args' =&gt; '',
                             'class' =&gt; 'main',
                             'line' =&gt; 20,
                             'prog' =&gt; 'script.pl',
                             'sub' =&gt; 'eval {...}',
                     }
             ],
     };

     # Print out.
     print err_json($err_hr);

     # Output:
     # {"msg":["FOO","KEY","VALUE"],"stack":[{"sub":"err","prog":"script.pl","args":"(2)","class":"main","line":1},{"sub":"eval {...}","prog":"script.pl","args":"","class":"main","line":20}]}

EXAMPLE2
     # Pragmas.
     use strict;
     use warnings;

     # Modules.
     use Error::Pure::Output::JSON qw(err_json);

     # Set pretty output.
     $Error::Pure::Output::JSON::PRETTY = 1;

     # Fictional error structure.
     my $err_hr = {
             'msg' =&gt; [
                     'FOO',
                     'KEY',
                     'VALUE',
             ],
             'stack' =&gt; [
                     {
                             'args' =&gt; '(2)',
                             'class' =&gt; 'main',
                             'line' =&gt; 1,
                             'prog' =&gt; 'script.pl',
                             'sub' =&gt; 'err',
                     }, {
                             'args' =&gt; '',
                             'class' =&gt; 'main',
                             'line' =&gt; 20,
                             'prog' =&gt; 'script.pl',
                             'sub' =&gt; 'eval {...}',
                     }
             ],
     };

     # Print out.
     print err_json($err_hr);

     # Output:
     # {
     #    "msg" : [
     #       "FOO",
     #       "KEY",
     #       "VALUE"
     #    ],
     #    "stack" : [
     #       {
     #          "sub" : "err",
     #          "prog" : "script.pl",
     #          "args" : "(2)",
     #          "class" : "main",
     #          "line" : 1
     #       },
     #       {
     #          "sub" : "eval {...}",
     #          "prog" : "script.pl",
     #          "args" : "",
     #          "class" : "main",
     #          "line" : 20
     #       }
     #    ]
     # }

DEPENDENCIES
    Exporter, JSON, Readonly.

SEE ALSO
    Error::Pure, Error::Pure::Output::Text.

REPOSITORY
    &lt;https://github.com/tupinek/Error-Pure-Output-JSON&gt;

AUTHOR
    Michal ﾅ�paﾄ稿k &lt;mailto:skim@cpan.org&gt;

    &lt;http://skim.cz&gt;

LICENSE AND COPYRIGHT
    BSD license.

VERSION
    0.08

</pre></body></html>