Plack (software)

Plack is a Perl web application programming framework inspired by Rack for Ruby and WSGI for Python,[1][2] and it is the project behind the PSGI specification used by other frameworks such as Catalyst and Dancer.

[4] Plackup is a command line utility to run PSGI applications from the command line.

[5] PSGI or Perl Web Server Gateway Interface is an interface between web servers and web applications and frameworks written in the Perl programming language that allows writing portable applications that can be run as standalone servers or using CGI, FastCGI, mod_perl, et al.[6] It is inspired by the Web Server Gateway Interface for Python, Rack for Ruby and JSGI for JavaScript.

A PSGI application is a Perl subroutine that accepts arguments as a single hash reference and returns a reference to an array of three elements: an HTTP status code, a reference to an array of HTTP headers and a reference to an array of HTTP body lines (usually a generated HTML document) or a filehandle-like object.

As of May 2023[update][7] Plack supports the following server backends: Using the default standalone HTTP server: Running as a FastCGI daemon listening on a Unix socket, ready to be used by any Web server with FastCGI support: A working Hello world application run as a one-liner: 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:

An example of server-side scripting using Perl, Plack and PSGI.