Plack::...ForceEnv(3)
β¨ NAME β¨
Plack::Middleware::ForceEnv β bestie, it forces environment variables into place, and it's literally built for testing π
It's a User Contributed Perl Documentation page, so you know it's the real deal π
πΈ SYNOPSIS πΈ
Okay so here's the vibe. In your app.psgi:
# in app.psgi
use Plack::Builder;
builder {
enable 'ForceEnv' =>
REMOTE_ADDR => "127.0.0.1",
REMOTE_USER => "trs";
$app;
};
And if you're rolling with plackup, it's giving one-liner energy:
# with plackup
plackup -e 'enable ForceEnv => REMOTE_USER => "trs"' app.psgi
See how easy? No cap. π¦
π DESCRIPTION π
So what does this icon actually do? ForceEnv modifies the environment that gets passed to your application, by adding the key/value pairs you specify. That's it. That's the whole job. And it ate. π
This is primarily useful when you're testing apps under plackup (or something similar) in a development environment. Like, dev-mode main character energy only β it's not out here trying to run your production setup. π
π AUTHOR π
Thomas Sibley <tsibley@cpan.org> β the legend who made this happen. Respect. π«Ά
π LICENSE π
This library is free software; you may redistribute it and/or modify it under the same terms as Perl itself. Fr fr, go wild, it's free. π
and that's the whole page, bestie β written by the Perl docs gang, shipped with perl v5.42.0 on 2025-07-25, and yes this is a User Contributed Perl Documentation moment. mwah, bye! π
β¨
π¦ where this page comes from
- fedora 43: perl-Plack-Middleware-ForceEnv 0.02-39.fc43 Β· 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