Filter::sh(3pm)
β¨ NAME β¨
Filter::sh β a lil sh source filter that rewrites your Perl before Perl ever sees it π
(it lives in the User Contributed Perl Documentation section of the manual, bestie β page Filter::sh(3pm))
πΈ SYNOPSIS πΈ
use Filter::sh 'command' ;
That's it. That's the whole vibe. π
π¦ DESCRIPTION π¦
okay so here's the tea β β this filter takes your current source file and pipes it straight through the program that your command parameter names, running it via the Bourne shell. So like. Your Perl gets a glow-up from a shell command before it's even compiled. iconic behavior honestly β¨
Now, important thing β like every single source filter ever β its scope is limited to the current source file only. No sneaky spreading to other files. Every file you want the filter to touch needs its own
use Filter::sh 'command' ;
sitting near the top. no exceptions, no shortcuts, fr fr π
Here's an example script that uses the filter:
use Filter::sh 'tr XYZ PQR' ;
$a = 1 ;
print "XYZ a = $a\n" ;
and here's what it spits out π
PQR = 1
see how tr XYZ PQR just swapped those letters out? ate and left no crumbs π
π WARNING π
bestie please be careful with this one. π
You should be very careful when using this filter. Because of the way the filter is implemented, it is possible to end up with a deadlock. That's not a vibe. That's the opposite of a vibe. π
And be especially careful when you're stacking multiple instances of the filter inside a single source file. Stack 'em and you might just lock everything up. the math is not mathing in your favor, ngl π
π AUTHOR π
Paul Marquess wrote this one. legend behavior, no cap. π«Ά
β DATE β
11th December 1995. yes bestie, a vintage. it was slaying before most of us could walk π β¨
k bye, and remember β this page came to you from perl v5.42.3, dated 2026-08-19, filed under Filter::sh(3pm) in the User Contributed Perl Documentation. mwah ππ
π¦ 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