TITLE
Plack::Middleware::Return::MultiLevel::Utils - Ease of Use Utility subroutines
SYNOPSIS
use Plack::Middleware::Return::MultiLevel::Utils
qw/return_to_level return_to_default_level/;
return_to_default_level($env,
[200, ['Content-Type', 'text/plain'], ['default']]);
return_to_level($env, 'set_level_name',
[200, ['Content-Type', 'text/plain'], ['named level']]);
DESCRIPTION
Ideally you'd invoke your Return::MultiLevel return points via one if these importable subroutines, rather than reaching into the psgi_env
hash. This gives you better encapsulation and allows the underlying code to change without busted your use.
EXPORTS
This class defines the following exportable subroutines
return_to_default_level
return_to_default_level($env,
[200, ['Content-Type', 'text/plain'], ['default']]);
Requires $psgi_env
and a response, which typically is a PSGI type response, athough you can return anything you want if there is middleware to convert it to an acceptable PSGI style response, for example.
This can also be imported and called as a method on an object that does the env
method. For example:
$catalyst_context->request->return_to_default_level(\@response);
return_to_level
return_to_level($env, 'set_level_name',
[200, ['Content-Type', 'text/plain'], ['named level']]);
Just like "return_to_default_level" except that the second argument is the name of a return level that you set. Also can be called as a method against an object that does env
.
AUTHOR
See Plack::Middleware::Return::MultiLevel
SEE ALSO
Plack::Middleware::Return::MultiLevel