you may need to try a few different approaches - in Perl there are heaps of options - as others have said, Google would find some, but, here's a simple one, using 'backticks'
my $str = `your-prog arg1 arg2 .. argn`;
$str will hold the result ('stdout') from your-prog