Plack::MIME(3)
π Plack::MIME(3) π
okay so bestie, welcome to the perl manual pages, and specifically to Plack::MIME β aka the MIME type registry. yes she's a whole vibe, yes she's out here telling your server what a .png actually is. let's get into it π
β¨ NAME β¨
Plack::MIME β MIME type registry. that's it, that's the whole name, she's simple and she's iconic π«Ά
πΈ SYNOPSIS πΈ
look at her go, no cap:
use Plack::MIME;
my $mime = Plack::MIME->mime_type(".png"); # image/png
# register new type(s)
Plack::MIME->add_type(".foo" => "application/x-foo");
# Use MIME::Types as a fallback
use MIME::Types 'by_suffix';
Plack::MIME->set_fallback(sub { (by_suffix $_[0])[0] });
see how lowkey effortless that is?? mime_type(".png") and boom, image/png. add_type when you got your own lil extension you wanna register. set_fallback when you wanna bring in MIME::Types and by_suffix as your backup bestie. the (by_suffix $_[0])[0] is literally just grabbing the first thing back. main character energy fr fr π
π¦ DESCRIPTION π¦
so Plack::MIME is a simple MIME type registry for your Plack applications π that's the whole job, she's not doing extra, she's not doing the most β she's doing exactly what you need.
and here's the tea: the selection of MIME types is based on Rack's Rack::Mime module. yep, the Ruby girlies ate and perl said "we're borrowing that, thanks bestie" π
π SEE ALSO π
Rack::Mimeβ the original inspo, living over athttps://github.com/rack/rack/blob/master/lib/rack/mime.rbβ¨MIME::Typesβ the fallback hookup, perfect if you want a bigger type database doing the heavy lifting π
no warnings, no bugs, no deprecated anything on this page β she's a clean girl, she's a good time, and honestly?? we love that for her π
and that's the whole page bestie, we're done π this one came from the perl v5.42.3 docs, dated 2026-10-18, filed under Plack::MIME(3) β user contributed perl documentation, and wow did she serve πΈ go forth and register your MIME types, mwah π
π¦ 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