Plack::App::Data::Printer - Plack Data::Printer application.
use Plack::App::Data::Printer; my $obj = Plack::App::Data::Printer->new(%parameters); my $psgi_ar = $obj->call($env); my $app = $obj->to_app;
Class inherites Plack::Component.
new
my $obj = Plack::App::Data::Printer->new(%parameters);
Constructor.
Returns instance of object.
data
Data structure to print out.
Parameter is required.
call
my $psgi_ar = $obj->call($env);
Implementation of Data::Printer in plack.
Returns reference to array (PSGI structure).
to_app
my $app = $obj->to_app;
Creates Plack application.
Returns Plack::Component object.
use strict; use warnings; use Plack::App::Data::Printer; use Plack::Runner; # Run application. my $app = Plack::App::Data::Printer->new( 'data' => { 'example' => [1, 2, { 'foo' => 'bar', }, 5], }, )->to_app; Plack::Runner->new->run($app); # Output: # HTTP::Server::PSGI: Accepting connections at http://0:5000/ # > curl http://localhost:5000/ # { # example [ # [0] 1, # [1] 2, # [2] { # foo "bar" # }, # [3] 5 # ] # }
Data::Printer, Error::Pure, Plack::Component, Plack::Util::Accessor.
https://github.com/michal-josef-spacek/Plack-App-Data-Printer
Michal Josef Špaček mailto:skim@cpan.org
http://skim.cz
© 2022 Michal Josef Špaček
BSD 2-Clause License
0.04
To install Plack::App::Data::Printer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Plack::App::Data::Printer
CPAN shell
perl -MCPAN -e shell install Plack::App::Data::Printer
For more information on module installation, please visit the detailed CPAN module installation guide.