hartlieb
asked on
2-way communication
I need to do the following because I am using mod_perl and I do not want to write then read from a temp file:
1. My script pipes info to gnuplot beta 3.6.
2. Gnuplot reads config info from standard in, creates plot in GIF format and outputs it on standard out.
3. My script captures gnuplot output to a varaible.
4. My script outputs varaible to web page.
I tried IPC::Open2 but could not capture all the output.
1. My script pipes info to gnuplot beta 3.6.
2. Gnuplot reads config info from standard in, creates plot in GIF format and outputs it on standard out.
3. My script captures gnuplot output to a varaible.
4. My script outputs varaible to web page.
I tried IPC::Open2 but could not capture all the output.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
do this:
undef($/); #make sure this is a forward slash
$Gif = <PARENT>;
undefining the $/ makes it read the whole file(pipe) at once.
You may want to change it back to $/="\n"; if you read any files after this one.
undef($/); #make sure this is a forward slash
$Gif = <PARENT>;
undefining the $/ makes it read the whole file(pipe) at once.
You may want to change it back to $/="\n"; if you read any files after this one.
ASKER
Thanks for the quick response. It was a nagging problem.
ASKER
from gnuplot.
I tried the following and It seems to work.
while (<PARENT>) {
$Gif .= $_;
}
Is there a better way as the output from gnuplot is binary?
Thanks for the quick response,