#!/usr/bin/perl
use warnings;
use strict;
use DBIx::Simple;
use CGI;
my $db = DBIx::Simple->connect('dbi:SQLite:dbname=mydatabase.db')
or die DBIx::Simple->error;
my $q = new CGI;
open (X_POINTS,"x_points.txt") || die "couldn't open the file!";
open (Y_POINTS,"y_points.txt") || die "couldn't open the file!";
# Insert all the x points in an array
my @x_points = <X_POINTS>;
# Insert all the y points in an array
my @y_points = <Y_POINTS>;
chomp(@x_points);
chomp(@y_points);
close(X_POINTS);
close(Y_POINTS);
print @x_points;
print @y_points;
my @webpages;
my $webpage_no = 728;
for (my $count=0; $count <= $webpage_no; $count++) {
$webpages[$count] = $db->query("SELECT webpage FROM webpages_dat
+a WHERE id = '$count'")->list;
}
chomp(@webpages);
print @webpages;
print q(<html>);
print q(<META NAME="Content-type" CONTENT="text/html">);
print q(<IMG SRC="Figure.gif" USEMAP="#clustermap">
<MAP NAME="clustermap"> );
for (my $secondcount=0; $secondcount <= $webpage_no; $secondcount++)
+{
print qq(<AREA SHAPE=circle COORDS="$x_points[$secondcount],$y_po
+ints[$secondcount],1" HREF="$webpages[$secondcount]">);
}
print q(</MAP>);
print q(</html>);