Filter::exec(3pm)
π Filter::exec β exec source filter π
okay so bestie, welcome to Filter::exec(3pm) β it lives in the User Contributed Perl Documentation section, and it is literally a source filter that runs your code through an external command. no cap. let's get into it π¦
β¨ SYNOPSIS β¨
use Filter::exec qw(command parameters) ;
that's it, that's the whole vibe check π you hand it a command and some parameters, and it does the thing.
πΈ DESCRIPTION πΈ
so here's the tea: this filter pipes the current source file through the program which corresponds to the command parameter. that's the whole job. it's giving middleman energy π
and like every other source filter ever, its scope is limited to the current source file only. it's not gonna wander around touching your other files, bestie β it stays in its lane. so every single file you want processed by the filter needs to have this
use Filter::exec qw(command ) ;
near the top. yes, every one. no skipping. iykyk π
now for the iconic example. here's a script that uses the filter:
use Filter::exec qw(tr XYZ PQR) ;
$a = 1 ;
print "XYZ a = $a\n" ;
and here's what it will output:
PQR = 1
see what happened?? the tr XYZ PQR ate those XYZs right up and turned them into PQRs. the way that it just... works. obsessed π₯
π WARNING π
okay bestie, this is the part where we take our earrings off and get serious for a sec. you should be very careful when using this filter. because of the way the filter is implemented, it is possible to end up with deadlock. like, full-on, nobody's moving, everything's just... stuck. π
and be especially careful when stacking multiple instances of the filter in a single source file. that's the high-risk zone right there. π¨
fr fr, do not just yolo this one. know what you're doing before you stack filters, okay? π«Ά
π AUTHOR π
Paul Marquess
(an absolute legend, we stan π)
π DATE π
11th December 1995.
a vintage icon, truly β¨
and that's the whole page, bestie! π this one's from perl v5.42.3 and it was pulled on 2026-08-19 β so yeah, go forth and filter responsibly, you gorgeous genius π§π slay! ππΈ
π¦ where this page comes from
- ubuntu stonking: libfilter-perl 1.65-1build1 Β· GPL-1.0-or-later OR Artistic-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms