Plack::...ler::CGI(3)
π Plack::Handler::CGI π
okay bestie, welcome to the manual page for Plack::Handler::CGI β that's the CGI handler for Plack, it lives in section 3 of the User Contributed Perl Documentation, and honestly? it's giving "small module, big main character energy." pull up a chair, we're doing this π
β¨ NAME β¨
Plack::Handler::CGI β CGI handler for Plack, fr fr. that's the whole name, that's the whole vibe π¦
πΈ SYNOPSIS πΈ
so you wanna run a PSGI application as a CGI script? periodt. literally just rename your .psgi to .cgi and swap out the shebang line like this:
#!/usr/bin/env plackup
# rest of the file can be the same as other .psgi file
yep that's it, the rest of the file stays exactly the same as any other .psgi file. slay β¨
orrr, alternative route, you can make a .cgi file that contains something like this instead:
#!/usr/bin/perl
use Plack::Loader;
my $app = Plack::Util::load_psgi("/path/to/app.psgi");
Plack::Loader->auto->run($app);
this one will auto-recognize the CGI environment variable to load this class. it just knows. iykyk π
and if you really wanna explicitly load the CGI handler β like, no auto-magic, you're doing it by hand β you can! for instance you might do this when you want to embed a PSGI application server built into a CGI-compatible perl-based web server:
use Plack::Handler::CGI;
Plack::Handler::CGI->new->run($app);
iconic behavior honestly π
π DESCRIPTION π
okay so, real talk: this is a handler module to run any PSGI application as a CGI script. that's its whole job and it does it beautifully. no notes. π«Ά
π UTILITY METHODS π
β setup_env()
my $env = Plack::Handler::CGI->setup_env();
my $env = Plack::Handler::CGI->setup_env(\%override_env);
this one sets up the PSGI environment hash for a CGI request, pulling from %ENV, and then hands it right back to you.
and get this β you can pass in a hashref of key/value pairs to override the defaults if that's what you wanna do. your request, your rules, bestie π
π SEE ALSO π
Plackβ yeah, the whole parent ecosystem, go say hi π¦
lowkey reminder: the descriptions above are the whole story β nothing extra, nothing invented, just the facts with a glow-up π
and that's a wrap! this page came to you from perl v5.42.3, dated 2026-10-18, filed under Plack::...ler::CGI(3) in the User Contributed Perl Documentation. mwah, bye bestie, go run some CGI πβ¨π
π¦ where this page comes from
- fedora 43: perl-Plack 1.0055-1.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- fedora 44: perl-Plack 1.0055-1.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms