What I am doing seems, to me, as if it should be fairly simple so I am probably going to facepalm after it is answered. With that being said:
I am trying to call an outside (non-PERL) function from within my PERL script. I would like to have the STDOUT from the function both printed to the console (as it occurs) and also I would like to capture that information and return it to the original PERL script that called it.
Attempted solutions include:
#does not return the output
my @output = system($cmd);
#does not display the output as it occurs
my @output = `$cmd`;
#does not display the output as it occurs
eval {$pid = open3($Input, $Output, $Error, $cmd); }; die "open3: $@\n" if $@;
Does anyone know a method that will both print the STDOUT to the screen (in realtime) and also capture the STDOUT and return it to the original source of the call?