# Mason-Dixon Trail Distance Calculator
# Version 2.0
# README File
# By Mike Calabrese
# http://www.mikecalabrese.com/index.shtml
# 03-26-2005

# This program is available for free on an AS-IS basis.  I am not
# responsible for consequential damages, loss of income or whatever
# else that may happen as a result  of the use of this program.

This program is designed to calculate the approxamate distance in miles
on the Mason-Dixon Trail between two given points.
The 4 files included are this README file, the Perl script mdtdist.pl,
the HTML page that points to this script called mdtdist.html and a  
compressed directory called points that contain the data files.
These files contain each point on the MDT and it's distance from the 
western terminus of the trail.

The way the script works is that the starting and ending point are passed
to the Perl script.  The appropriate files for these scripts are then 
opened, the points and distances are read, the starting point is then 
subtracted from the ending point and the absolute value of the difference
is then passed to the user. This script has been tested on UNIX and 
LINUX environments successfully.

The following configuration changes need to be made in order to successfully 
run this program:

1) Place the HTML page mdtdist.html on your server where your other HTML 
documents reside.  Be sure to change the "FORM ACTION" line to point to 
the url location of mdtdist.pl.  (For example- 
<FORM ACTION="http://www.yourdomain.com/cgi-bin/mdtdist/mdtdist.pl"> )

2) Place the perl script mdtdist.pl in your cgi-bin directory within it's 
own directory called mdtdist.  Be sure to 
chmod mdtdist.pl to 755 and the mdtdist directory to 755.  On some servers 
you will have to chgrp these files to the proper ownership name for your site.
The only 3 things in this file that need to be changed are:
a) Make sure that your path to Perl is correct (typing "which perl" at the 
command line will answer that. Be sure that your Perl path is the first line
of the mdtdist.pl script.
b) Make sure that the $refurl variable is set to the exact url path to your 
mdtdist.html file.  The bad referer subroutine keeps others from copying your 
html form and pointing to your cgi.  Please note that on some servers you have 
to change the extension of the Perl script from .pl to .cgi.

3) Place the points directory within the mdtdist directory and untar & gunzip
it there.  Chmod the points directory to 755 and the files within it to 755.
On some sites, you will have to chgrp them to the proper group name.
Type in PWD and copy the exact UNIX path to this directory. 
Then be sure to go back to the mdtdist.pl file and make sure that the   
$points_directory variable points to this directory.   

This program could also be modified to connect to a database to retrieve 
the points and distances.   Please do not remove the code that references the
Mason-Dixon Trail System on the html page as well as in the Perl script.

If you are upgrading from version 1.0 to version 2.0, it is advisable to
replace the mdtdist.html, mdtdist.pl and the points files as the trail
has increased in length from 190 to 193 miles and numerous points have
changed.