Listing 2. The getImageMapCoords() subroutine  
sub getImageMapCoords {
  my $param = $ENV{QUERY_STRING}; 

  # Check that parameters are indeed valid numbers in the form of X,Y
  #
  unless ($param =~ m/^(\d+),(\d+)/) {
    die "Invalid image map coordinates";
  }

  my ($x, $y) = ($1, $2);

  return ($x, $y);
}