#!/usr/local/bin/perl
use strict;
use warnings;
use Twister;
my $cmdname = $0; $cmdname =~ s{.*/}{};
my @twisters = ();
while (@ARGV > 0) {
my $module = shift; my %options = ();
while (@ARGV > 0 && $ARGV[0] =~ m{^(\w+)=(.*)}) {
$options{$1} = $2; shift;
}
my $twister = Twister->create($module, %options);
die "$cmdname: unknown twister: $module\n"
unless defined $twister;
push(@twisters, $twister);
}
while (<>) {
my $string = $_;
foreach my $twister (@twisters) {
$string = $twister->twist($string);
}
print $string;
}
|