#!/usr/bin/perl # map.cgi - give a latitude & longitute, display a water of the world # Eric Lease Morgan # October 1, 2006 - first cut # require use CGI; use CGI::Carp qw(fatalsToBrowser); # define use constant LAT => 41.411862; use constant LNG => -50.15888; use constant DEFAULT_ZOOM => 2; use constant SPECIFIC_ZOOM => 12; # initalize my $cgi = new CGI; my $html = &get_template; my $lat = $cgi->param('lat'); my $lng = $cgi->param('lng'); # check for input if ( $lat && $lng ) { # build the display $html =~ s/##LAT##/$lat/e; $html =~ s/##LNG##/$lng/e; $html =~ s/##ZOOM##/SPECIFIC_ZOOM/e; } # default values else { $html =~ s/##LAT##/LAT/e; $html =~ s/##LNG##/LNG/e; $html =~ s/##ZOOM##/DEFAULT_ZOOM/e; } # done print $cgi->header(-type => 'text/html', -charset => 'UTF-8'); print $html; exit; # return an html template sub get_template { return < Eric Lease Morgan's Water Collection Eric Lease Morgan's Water Collection - Map view

Eric Lease Morgan's Water Collection - Map view

EOT }