in reply to perl in ksh
command ... | perl your_perl_script.pl [download]
And in your_perl_script.pl read the data from STDIN.