Plack::...Refresh(3)
β¨ Plack::...Refresh(3) β¨
okay bestie, so this is a page from the User Contributed Perl Documentation collection, and it's literally all about hot-swapping your Perl code mid-development without restarting anything. it's giving β¨live reloadβ¨ energy. let's get into it π
π NAME π
Plack::Middleware::Refresh β refreshes all the modules in %INC, no cap π«Ά
π¦ SYNOPSIS π¦
enable "Refresh", cooldown => 3;
$app;
look at that. two lines. iconic. π
πΈ DESCRIPTION πΈ
so like, this is yet another approach to refreshing the modules sitting in %INC while you're in your development cycle, and the whole point is you don't need a forking process out there creeping on the filesystem watching for updates. nope. not here. π
instead, this middleware does the vibe check at request time: it compares the last refresh time against the current time, and if the difference is bigger than the cooldown seconds β which defaults to 10 β it calls Module::Refresh to reload every Perl module in %INC, but only if the files have actually been modified. lowkey genius honestly. β
heads up bestie: this only reloads modules. it does not touch other files, like your templates. templates are not invited to this party π
it's also quite similar to what Rack::Reoader does. and if you're having issues with this reloading technique β like, say, when you have in-file templates that need to be recompiled, or Moose classes that have make_immutable β then go take a look at plackup's default -r option, or Plack::Loader::Shotgun instead. different tool, different vibe. π₯
π AUTHOR π
Tatsuhiko Miyagawa
π SEE ALSO π
Module::RefreshRack::Reloader
and that's the whole thing fr fr π written against perl v5.42.3, dated 2026-10-18. slay, go refresh something π§β¨
π¦ 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