Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
miyagawa committed Jan 15, 2010
1 parent 99f131f commit 50cd1d5
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions lib/Plack/Server/CGI.pm
Expand Up @@ -89,21 +89,24 @@ __END__
=head1 SYNOPSIS
## in your .cgi
#!/usr/bin/perl
use Plack::Server::CGI;
# or Plack::Util::load_psgi("/path/to/app.psgi");
my $app = sub {
my $env = shift;
return [
200,
[ 'Content-Type' => 'text/plain', 'Content-Length' => 13 ],
[ 'Hello, world!' ],
];
};
Plack::Server::CGI->new->run($app);
### rename .psgi to .cgi and change the shebang line this way:
#!/usr/bin/env plackup
# rest of the file can be the same as other .psgi file
### Or, you can also say
#!/usr/bin/perl
use Plack::Loader;
my $app = Plack::Util::load_psgi("/path/to/app.psgi");
Plack::Loader->auto->run($app); # this will autoload CGI handler
### Or, if you really want to be explict (NOT RECOMMENDED)
#!/usr/bin/perl
use Plack::Server::CGI;
Plack::Server::CGI->new->run($app);
=head1 DESCRIPTION
This is a handler module to run any PSGI application as a CGI script.
=head1 SEE ALSO
Expand Down

0 comments on commit 50cd1d5

Please sign in to comment.