in reply to Checking where my CGI is bing called from.

You can use these environment variables, which are in %ENV: These are the main ones to use, although the last is not as reliable as the first two and can be easily faked. However, a simple check should keep out 99.9% of the people:
unless ($ENV{'HTTP_REFERER'} eq "$mypage") { print "Access forbidden. Goodbye.\n"; exit; }
P.S. Yes, 'referer' is spelled wrong, but that's now the official way. :)