in reply to using data from an os program

G'day sewood,

Welcome to the Monastery.

If you're doing this on the command line, you can just pipe STDOUT from your first program to your Perl program and, in turn, pipe its STDOUT to your second program. Something like this:

$ os_prog_1 | perl_prog | os_prog_2

See "perlop: I/O Operators" for full details of reading STDIN in your Perl code. Here's a highly contrived, minimal example which just reads input and passes it on unchanged (presumably, you'll want some processing to actually occur):

$ ls -l | perl -e 'while (<>) { print }' | wc -l 821

And, just to confirm the Perl code was passing on each line:

$ ls -l | wc -l 821

— Ken