#!/usr/bin/perl -w use strict; use warnings; use CGI qw/:standard *table *Tr *td/; use CGI::Carp qw(fatalsToBrowser); use Date::Manip; use DBI; use GD::Graph; use GD::Graph::bars; use GD::Graph::lines; use GD::Graph::linespoints; my $image_directory="/var/www/html/foo/bar/"; my $image_web_path="http://(IPaddress here)/foo/bar/"; print "Cache-Control: no-cache\n"; print header; print start_html( -title=>'Online search', -style=>'(link to style sheet)' ); my @imagefiles; for (my $i=1; $i<=8; $i++){$imagefiles[$i]=$image_directory.'imagefile'.$i.'.gif';} ... (form to acquire parameters specifying beginning and ending of search period) ... (database interrogation based on above search period, writing data to various data structures, then preparing the data to be processed by GD::Graph) ... #Output the results of the database interrogation as a graph using GD::Graph and write it to file like so: open IMAGEFILE, ">$imagefiles[6]" or die "Couldn't open $imagefiles[6]:$!"; binmode STDOUT; my $gd3_lines_average=$linegraph3_average->plot(\@linedata3_average)->$format3_lines_average() or die $linegraph3_average->error; print IMAGEFILE $gd3_lines_average; close IMAGEFILE; ... Create the other image files in a similar way to the one above ... print img({-src=>$image_web_path.'imagefile6.gif',-width=>"400",-height=>"300",-alt=>"No of foos in month bar"}) ... Retrieve the other image files in a similar way to the one above ... print end_html;