CGI::Header::PSGI - Generate PSGI-compatible response header arrayref
use CGI::PSGI; use CGI::Header::PSGI; my $app = sub { my $env = shift; my $query = CGI::PSGI->new( $env ); my $header = CGI::Header::PSGI->new( query => $query ); my $body = do { # run CGI.pm-based application }; return [ $header->status_code, $header->as_arrayref, [ $body ] ]; };
This document refers to CGI::Header::PSGI 0.14.
This module can be used to convert CGI.pm-compatible HTTP header properties into PSGI response header array reference.
This module requires your query class is orthogonal to a global variable %ENV. For example, CGI::PSGI adds the env attribute to CGI.pm, and also overrides some methods which refer to %ENV directly. This module doesn't solve those problems at all.
%ENV
env
This class adds the following methods to CGI::Header:
Returns HTTP status code.
Returns PSGI response header array reference.
CGI::Emulate::PSGI
Ryo Anazawa (anazawa@cpan.org)
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
To install CGI::Header::PSGI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CGI::Header::PSGI
CPAN shell
perl -MCPAN -e shell install CGI::Header::PSGI
For more information on module installation, please visit the detailed CPAN module installation guide.