vee/sample-hooks/vee-hookmanager.pl

35 lines
822 B
Perl
Raw Normal View History

2020-07-10 22:47:12 -04:00
#!/usr/bin/perl
# helps facilitate the applications of multiple filters in-line
# set as teh main vee-filter, and it will apply the stream to the
# set filters in the order listed
use strict;
use warnings;
$|++;
# define filter dir here
my $FILTERDIR = "sample-filters/";
# add new filters to the list - note, they are run in top-down order
# warning - filters are not checked for existence first
my @FILTERS = (
"$FILTERDIR/vee-filter.sh",
"$FILTERDIR/vee-filter.pl",
,);
#
# automated from here on out - do not touch
#
my $FILTERS = join("|",@FILTERS);
my $out = "";
# loop over STDIN and capture qscript
while (<>) {
$out .= $_;
}
# open pipe to filters, execute
open(FILTER, "|$FILTERS");
# send contents of qscript to filters
print FILTER $out;
close(FILTER);