World Library  
Flag as Inappropriate
Email this Article

Plack (software)

Article Id: WHEBN0026617189
Reproduction Date:

Title: Plack (software)  
Author: World Heritage Encyclopedia
Language: English
Subject: Dancer (software), Perl, Rack (web server interface), Perl package manager, Qrpff
Collection:
Publisher: World Heritage Encyclopedia
Publication
Date:
 

Plack (software)

Plack is a set of tools for Perl programming of Web applications and running frameworks compatible with the PSGI specification, such as Catalyst and Dancer.

Plack was inspired by Rack for Ruby and WSGI for Python.[1]

Plackup is a command-line tool for running the PSGI applications,

Supported backends

As of March 2010[2] Plack supports the following server backends:

  • CGI
  • SCGI
  • FastCGI
  • mod_perl under Apache 1.3 and 2.0
  • Standalone HTTP server included in Plack
  • HTTP::Server::Simple
  • Corona
  • Starman
  • Twiggy
  • AnyEvent::HTTPD
  • AnyEvent::ReverseHTTP

Examples

Using the default standalone HTTP server:

$ plackup app.psgi 
HTTP::Server::PSGI: Accepting connections at http://0:5000/

Running as a FastCGI daemon listening on a Unix socket, ready to be used by any Web server with FastCGI support:

$ plackup -s FCGI --listen /tmp/fcgi.sock app.psgi
FastCGI: manager (pid 3336): initialized
FastCGI: manager (pid 3336): server (pid 3337) started
FastCGI: server (pid 3337): initialized

A working Hello world application run as a one-liner:

$ plackup -e '
sub { [200, ["Content-Type" => "text/plain"], ["Hello, world!"]] }
'
HTTP::Server::PSGI: Accepting connections at http://0:5000/

The command above starts an HTTP server listening on port 5000 of every local interface (IP address) and returns this 200 OK response to every HTTP request:

HTTP/1.0 200 OK
Date: Fri, 19 Mar 2010 23:34:10 GMT
Server: HTTP::Server::PSGI
Content-Type: text/plain
Content-Length: 13

Hello, world!

References

  1. ^ http://plackperl.org
  2. ^ Plack::Handler modules on CPAN

External links

  • PSGI and Plack website
  • Plack documentation
  • manualplackup


This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and USA.gov, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for USA.gov and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
 
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
 
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.
 


Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.