return to first page linux journal archive
keywordscontents

Listing 2. graph-demo.pl

#!/usr/bin/perl -wT
# graph-demo.pl
use strict;
use diagnostics;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use GIFgraph::bars;
# Create an instance of CGI
my $query = new CGI;
# Set the data
my @data = (["a", "b", "c"], [1, 2, 3]);
# Send an appropriate MIME header
print $query->header(-type => "image/gif");
# Create a graph object
my $graph = new GIFgraph::bars;
# Draw the graph
print $graph->plot(\@data);