I have a problem, I tried creating another sub routine in my .pl file and i can't get it to work.
here is a copy of the new sub routine and want to call this sub routine in using the sub html_footer routine.
I can rename this to test.cgi and it runs ok on it own as well
sub html_graph {
#!c:/perl/bin/perl
use perlchartdir;
# The data for the line chart.
my $data0 = [$rec{'23:00'},$rec{'23:00'}];
my $data1 = [$rec{'23:00'},$rec{'23:00'}];
my $data2 = [$rec{'23:00'},$rec{'23:00'}];
# The labels for the line chart.
my $labels = ["0", "", "", "3", "", "", "6", "", "", "9", "", "", "12","", "", "15", "", "", "18", "", "", "21", "", "", "24"];
# Create a XYChart object of size 500 x 300 pixels.
my $c = new XYChart(500, 300);
# Set background color to pale yellow 0xffff80, with a black edge and a 1.
# pixel 3D border.
$c->setBackground(0xffff80, 0x0, 1);
# Set the plotarea at (55, 45) and of size 420 x 210 pixels, with white.
# background. Turn on both horizontal and vertical grid lines with light.
# grey color (0xc0c0c0).
$c->setPlotArea(55, 45, 420, 210, 0xffffff, -1, -1, 0xc0c0c0, -1);
# Add a legend box at (55, 25) (top of the chart) with horizontal layout.
# Use 8 pts Arial font. Set the background and border color to Transparent.
$c->addLegend(55, 25, 0, "", 8)->setBackground($perlchartdir::Transparent);
# Add a title box to the chart using 11 pts Arial Bold Italic font. The text.
# is white (0xffffff) on a dark red (0x800000) background, with a 1 pixel 3D.
# border.
$c->addTitle("Daily Server Load", "arialbi.ttf", 11, 0xffffff)->setBackground(0x800000, -1, 1);
# Add a title to the y axis.
$c->yAxis()->setTitle("MBytes");
# Set the labels on the x axis.
$c->xAxis()->setLabels($labels);
# Add a title to the x axis.
$c->xAxis()->setTitle("Jun 12, 2001");
# Add a line layer to the chart.
my $layer = $c->addLineLayer();
# Set the default line width to 3 pixels.
$layer->setLineWidth(3);
# Add the three data sets to the line layer.
$layer->addDataSet($data0, -1, "Server # 1");
$layer->addDataSet($data1, -1, "Server # 2");
$layer->addDataSet($data2, -1, "Server # 3");
# output the chart in PNG format.
binmode(STDOUT);
print "Content-type: image/png\n\n";
print $c->makeChart2($perlchartdir::PNG);
}
here is a copy of the sub html_footer routine
sub html_footer {
# --------------------------------------------------------
# Print the menu and the footer and logo. It would be nice if you left
# the logo in. ;)
#
# We only print options that the user have permissions for.
#
my $font = 'Font face="Verdana, Arial, Helvetica" Size=2';
print qq!<P align=center><$font>!;
print qq!| <A HREF="$db_script_link_url">Home</A> !;
print qq!| <A HREF="$db_script_link_url&add_form=1">Add</A> ! if ($per_add);
print qq!| <A HREF="$db_script_link_url&view_search=1">View</A> ! if ($per_view);
print qq!| <A HREF="$db_script_link_url&delete_search=1">Delete</A> ! if ($per_del);
print qq!| <A HREF="$db_script_link_url&modify_search=1">Modify</A> ! if ($per_mod);
print qq!| <A HREF="$db_script_link_url&view_records=1&$db_key=*">List All</A> ! if ($per_view);
print qq!| <A HREF="$db_script_link_url&admin_display=1">Admin</A> ! if ($per_admin);
print qq!| <A HREF="$db_script_link_url&whos_online=1">Who's Online</A> ! if ($per_view);
print qq!| <A HREF="$db_script_link_url&logoff=1">Log Off</A> |!;
print qq!</font></p>!;
# Print the Footer -- note: a link (doesn't have to be the graphic) is required unless you purchase
# a license. See: http://gossamer-threads.com/scripts/register/ for more info.
print qq!
print qq|</font></p>|;
&html_footer; print qq|
!;
}
Any help would be greatfull as I really need to get this working..

