
October 29th, 2012, 06:45 PM
|
|
|
|
Odd output from open with pipe
I am using the following code to launch a script and capture the output to a file.
Code:
open($pipe,"$helper_utils/collect_user_metrics.pl $url |") || die("Cannot run collect_user_metrics.pl: ".$!);
open($fh,'>',"$tempoutput/collect_user_metrics.txt");
print $fh while <$pipe>;
close($pipe);
close($fh);
However, when this is executed I get the following output from my script (not in the capture file):
GLOB(0xa01d5b4)GLOB(0xa01d5b4)GLOB(0xa01d5b4)GLOB(0xa01d5b4)GLOB(0xa01d5b4)GLOB(0xa01d5b4)GLOB(0xa01 d5b4)GLOB(0xa01d5b4)GLOB(0xa01d5b4)GLOB(0xa01d5b4)GLOB(0xa01d5b4)GLOB(0xa01d5b4)GLOB(0xa01d5b4)GLOB( 0xa01d5b4)GLOB(0xa01d5b4)GLOB(0xa01d5b4)GLOB(0xa01d5b4)GLOB(0xa01d5b4)GLOB(0xa01d5b4)GLOB(0xa01d5b4) GLOB(0xa01d5b4)GLOB(0xa01d5b4)GLOB(0xa01d5b4)GLOB(0xa01d5b4)GLOB(0xa01d5b4)GLOB(0xa01d5b4)GLOB(0xa01 d5b4)GLOB(0xa01d5b4)GLOB(0xa01d5b4)GLOB(0xa01d5b4)GLOB(0xa01d5b4)GLOB(0xa01d5b4)
If I comment out the above code, this output goes away and if I run the called script from the command line there is no such output, so clearly it is caused by the pipe. What is this and how do I stop it? TIA.
__________________
There are 10 kinds of people in the world. Those that understand binary and those that don't.
|