IPC::Filter(3pm)
π IPC::Filter β the manual, but make it a group chat π
okay bestie, so IPC::Filter is a Perl module β yeah, that (3pm) situation β and its whole thing is filtering data through an external process. That's the NAME, that's the vibe, that's the whole personality. π¦
β¨ SYNOPSIS β¨
use IPC::Filter qw(filter);
$compressed_data = filter($data, "bzip2");
that's it. that's the moment. you import filter, you hand it your data and a command, and it hands you back the glow-up version. π
πΈ DESCRIPTION πΈ
so the filter function that this module ships passes your data through an external command. why does that matter? because it gives you filtering in non-pipeline situations β i.e. when you're not sitting in a shell going | | | like it's a whole thing. you just call it from Perl and it does the pipe work for you. no cap. π«Ά
π FUNCTIONS π
filter(DATA, SHELL_COMMAND)
filter(DATA, PROGRAM, ARGS ...)
okay so here's the tea. β
- The
SHELL_COMMAND, or thePROGRAMwithARGSif you supplied more arguments, gets executed as a separate process. it's giving "spawn a whole little guy and make it do your bidding." - lowkey important: the arguments other than
DATAare ultimately passed toexec. so if you wanna know how it decides between those two forms, go read"exec"inperlfunc(1)β it explains the choice. iykyk. π - the
DATAβ which must be either a simple string or a reference to a string β gets supplied to the process on its standard input. - then the process's standard output is captured and returned, as a simple string. so you get your result back like a little gift. π
- and if the process exits with a non-zero exit code, or on a signal, the function will
die. π yes really. dramatic but fair.- in the case of a non-zero exit code, the
diemessage will duplicate the process's standard error output β so you actually see what went wrong. - in any other case, the error output is discarded. gone. thrown away. not even a text back. π
- in the case of a non-zero exit code, the
bestie heads up: DATA being neither a simple string nor a reference to a string is not a vibe this function accepts. string or string-ref, periodt.
π SEE ALSO π
IPC::Open2
go look, it's the cousin. π§
π AUTHOR π
Andrew Main (Zefram) <zefram@fysh.org> β the icon who wrote this. π«‘
π COPYRIGHT π
Copyright (C) 2004, 2007, 2010, 2011, 2017 Andrew Main (Zefram) <zefram@fysh.org>
π LICENSE π
this module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. slay, honestly. β¨
and that's the whole page, bestie β brought to you by perl v5.36.0, dated 2022-11-19, filed under IPC::Filter(3pm). mwah. πππ¦
π¦ where this page comes from
- debian bookworm: libipc-filter-perl 0.005-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libipc-filter-perl 0.005-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libipc-filter-perl 0.005-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libipc-filter-perl 0.005-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libipc-filter-perl 0.005-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms