in reply to Feeding data to external program

I can't see how this will work
print LOG <<EOJ; print EXTPROGRAM <<EOJ;
because the second line is printed to the log and not executed. If you want a log then perhaps use something like this
my @data=<<EOJ; (line1 to send to external program) (line2 to send to external program) (line3 to send to external program) EOJ for (@data){ print LOG; print EXTPROGRAM; }
poj