App::Spec::Run::Response - Response class for App::Spec::Run
If you pass it a string, it will create a App::Spec::Run::Output.
$res->add_output("string\n", "string2\n"); my $output = App::Spec::Run::Output->new( content => "string\n", ); $res->add_output($output);
This will call print_output if buffered is false, otherwise it will add the output to outputs
print_output
outputs
Like add_output, but the created Output object will have an attribute error set to 1.
add_output
error
$res->add_error("string\n", "string2\n"); my $output = App::Spec::Run::Output->new( error => 1, content => "string\n", ); $res->add_error($output);
$res->print_output(@out);
Prints the given output and all output in outputs.
$response->add_callbacks(print_output => \@callbacks);
Where @callbacks are coderefs.
@callbacks
If true, output should be buffered until print_output is called.
Default: false
The exit code
Holds an array of App::Spec::Run::Output objects.
Set to 1 after print_output has been called.
If set to 1, no further processing should be done.
Contains a hashref of callbacks
{ print_output => $coderef, },
To install App::Spec, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::Spec
CPAN shell
perl -MCPAN -e shell install App::Spec
For more information on module installation, please visit the detailed CPAN module installation guide.