# WO&D Trail Distance Calculator # Version 1.0 # README File # By Mike Calabrese # http://www.mikecalabrese.com # 06-20-2001 # 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 WO&D Trail in northern VA between two given points. The 4 files included are this README file, the Perl script woddist.pl, the HTML page that points to this script called woddist.html and a compressed directory called points that contain data files. These files contain each point on the WO&D and it's distance from the eastern 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 woddist.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 woddist.pl. (For example- <FORM ACTION="http://www.yourdomain.com/cgi-bin/woddist/woddist.pl"> ) 2) Place the perl script woddist.pl in your cgi-bin directory within it's own directory called woddist. Be sure to chmod woddist.pl to 755 and the woddist 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 woddist.pl script. b) Make sure that the $refurl variable is set to the exact url path to your woddist.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 woddist 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 woddist.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 Friends of the WO&D Trail on the html page as well as in the Perl script.