#!/usr/local/bin/perl =pod this is locatomatic a simple CGI script in perl 5 that looks for a hypertext http... in the query_string and returns it as the object of a Location: header Locatomatic is a TipJar NetToy Copyright 1999 David L. Nicol permission to install, use and modify granted to all on condition of the name of the program remaining "locatomatic" and the unmodified text of this paragraph remaining in the comments. =cut if ($ENV{'QUERY_STRING'}=~m%(http[^\s&]+)%){ $loca = $1; $loca =~ s/%(..)/chr(hex($1))/ge; print "Location: $loca\n\n"; exit; }; # The following text would be a good thing to customize # on installation of this script print <<"ENDMESG"; Content-Type: text/html bad data for locatomatic Sorry, but I could not find a hypertext URL in the GET-style form data
$ENV{'QUERY_STRING'}

Please notify the maintainers of the invoking page, $ENV{'HTTP_REFERER'}, of this error.

The script looks for "http" to mark the beginning of hypertext urls, and does not care about variable names.

Locatomatic is a TipJar NetToy. ENDMESG