NAME

Template::Flute::Iterator::JSON - Iterator class for JSON strings and files

SYNOPSIS

    $json = q{[
        {"sku": "orange", "image": "orange.jpg"},
        {"sku": "pomelo", "image": "pomelo.jpg"}
    ]};

    $json_iter = Template::Flute::Iterator::JSON->new($json);

    $json_iter->next();

    $json_iter_file = Template::Flute::Iterator::JSON->new(file => 'fruits.json');

DESCRIPTION

Template::Flute::Iterator::JSON is a subclass of Template::Flute::Iterator.

CONSTRUCTOR

new

Creates an Template::Flute::Iterator::JSON object from a JSON string.

The JSON string can be either passed as such or as scalar reference.

AUTHOR

Stefan Hornburg (Racke), <racke@linuxia.de>

LICENSE AND COPYRIGHT

Copyright 2011-2021 Stefan Hornburg (Racke) <racke@linuxia.de>.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.