Ryo Anazawa > CGI-Header-0.55 > CGI::Header::Standalone



Annotate this POD

View/Report Bugs
Source   Latest Release: CGI-Header-0.56


CGI::Header::Standalone - Alternative to CGI::Header


  use CGI::Header::Standalone;
  my $h = CGI::Header::Standalone->new; # behaves like CGI::Header object


This module inherits from CGI::Header, and also adds the following methods to the class:

$headers = $header->as_arrayref

Returns an arrayref which contains key-value pairs of HTTP headers.

  # => [
  #     'Content-length' => '3002',
  #     'Content-Type'   => 'text/plain',
  # ]

This method helps you write an adapter for mod_perl or a PSGI application which wraps your CGI.pm-based application without parsing the return value of CGI.pm's header method.


Return the header fields as a formatted MIME header. If the nph property is set to true, the Status-Line is inserted to the beginning of the response headers.

This module overrides the following method of the superclass:


Behaves like CGI.pm's header method. In mod_perl environment, unlike CGI.pm's header method, this method updates "headers_out" method of request_rec object directly, and so you can send headers effectively.


Ryo Anazawa (anazawa@cpan.org)


This module is free software; you can redistibute it and/or modify it under the same terms as Perl itself. See perlartistic.

syntax highlighting: