Exec(3pm)

πŸ’– NAME πŸ’–

okay so Filter::Util::Exec β€” it's an exec source filter, bestie. that's it, that's the whole vibe. it's a Perl module (you can tell bc it's the Exec(3pm) page, iykyk) πŸ’…


✨ SYNOPSIS ✨

use Filter::Util::Exec;

that's literally all you need to get in the door 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so this module, right? it provides the interface that lets you create Source Filters that run off a Unix coprocess. like, the source filter plumbing, and the Unix coprocess is the engine underneath. periodt. πŸ”₯

want to see it in action? go peek at these iconic queens:

  • Filter::exec
  • Filter::cpp
  • Filter::sh

they're all examples of using this module. real ones fr fr πŸ’œ

⚠️ heads up bestie β€” the size of the buffers is limited to 32-bit. not big. not huge. 32-bit. know that before you start throwing megabytes at it 😭

🌸 filter_add() 🌸

this function, filter_add, is the one that installs a filter. iconic behavior honestly. ✨

it takes one parameter, and that parameter should be a reference. and here's the tea β€” the kind of reference you hand it decides which of the two filter types you get. it's giving choose-your-own-adventure but for filtering. πŸŽ€

  • if you pass in a CODE reference, then a closure filter is assumed. slay.
  • if you do not pass in a CODE reference, then a method filter is assumed. different vibe, still valid. πŸ’…

and the method filter girlies get a lil bonus: in a method filter, the reference can be used to store context information. then that reference gets blessed into the package by filter_add. yes she gets a glow-up and a whole package to live in πŸ‘‘

want examples of using context information with both method filters and closure filters? go check out Filter::Util::Call. it has receipts. 🧚


πŸ‘‘ AUTHOR πŸ‘‘

Paul Marquess β€” the one and only, the main character who wrote this πŸ’–


🌈 DATE 🌈

11th December 1995. a whole legend. a pioneer. we stan. ⭐


okay so that's the whole page bestie, go filter some source and be great πŸ¦‹βœ¨

perl v5.42.3 Β· 2026-08-19 Β· mwah, bye, don't forget to use her πŸ’œπŸ™ˆ

πŸ“¦ where this page comes from