In a browser running a perl CGI-BIN program(Linux) I want to call another program (FORTRAN program running on Linux) to extract data which passes back the data (after a lot of mathematical processing) to the perl program, and the result being 2 HTML tables followed by a single gnuplot plot of curves all on one page of the browser.
I can do just the HTML tables output no worries.
I think I can do the curves on a page on its own without the use of creating files on the Linux server and linking back to it from the HTML. That is generating the plot straight to the browser using:
(sample of code below)
print GP "set terminal png small color");
print GP "title ...
print GP ....size, border, logscale,xrange,yrange,xlabel,ylabel,xtics,grid etc etc
# initiate the plot
print GP "plot '-' using 1:2 title \"1 year\" with linespoints lt 1 pt 1 ps 2, '-' using 1:2 title ...etc
The problem with this code above is I can ONLY plot the gnuplot curve on the browser page because of the' image/png' header telling the browser the following data hitting the browser is an image. That is I cannot put the HTML tables below or above the gnuplot.
Any ideas how I can get both HTML generated tables of the data, PLUS an image generated on the fly by gnuplot?
P.S. The gnuplot module within perl is not installed on this system (I believe), and not sure if they would either. Gnuplot is installed as a standalone appilcation on the unix server though.
Note I am trying to to all this without creating files on the Linux server and then linking to it in the HTML followed by necessary file cleanup, unless you can help me with creating random filenames, and cleaning up afterwards I suppose. This program may be called by many people on a high traffic site.