Mike, is the 'ticket' program expecting input from the command-line or on STDIN? If it is expecting input from STDIN and you want to process it's STDOUT, you can use IPC::Open2:
test3.pl (emulates 'ticket' program')
#!/usr/bin/perl -w
use strict;
while (<STDIN>) {
print "PROCESSED $_";
}
test4.pl
#!/usr/bin/perl -w
use strict;
$|++;
use IPC::Open2;
my @loglines=("This is not a relevant logline",
"This is not a relevant logline",
"This might be an interesting logine",
"Another interesting logline");
open2(*READ,*WRITE,"./test3.pl") or die;
foreach my $inputline (@loglines) {
print WRITE "$inputline\n";
}
close (WRITE);
my $outputline;
while ($outputline = <READ>) {
print $outputline;
}
As a sidestep: if you use 'open', please check if it succeeds, like:
open(RUN, "/usr/local/bin/ticket @ABC|") or die "useful error message
+here";