Plack::Middleware::Return::MultiLevel::Utils - Ease of Use Utility subroutines
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']]);
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.
psgi_env
This class defines the following exportable subroutines
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.
$psgi_env
This can also be imported and called as a method on an object that does the env method. For example:
env
$catalyst_context->request->return_to_default_level(\@response);
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.
See Plack::Middleware::Return::MultiLevel
Plack::Middleware::Return::MultiLevel
To install Plack::Middleware::Return::MultiLevel, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Plack::Middleware::Return::MultiLevel
CPAN shell
perl -MCPAN -e shell install Plack::Middleware::Return::MultiLevel
For more information on module installation, please visit the detailed CPAN module installation guide.