Scroll to navigation

App::Spec::Run::Response(3) User Contributed Perl Documentation App::Spec::Run::Response(3)

NAME

App::Spec::Run::Response - Response class for App::Spec::Run

METHODS

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"

Like "add_output", but the created Output object will have an attribute "error" set to 1.

    $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.

ATTRIBUTES

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,
    },
    
2025-03-26 perl v5.42.1