As others have commented, your question is a bit unusual. If you could explain the background of why you want to keep your script in the public cgi-bin but only allow the server to access it, in other words what bigger problem you're trying to solve, we might be able to suggest more and better solutions. Also, who will be accessing your script, and will it always be accessed via HTTP/CGI, or could it be run from the command line too? (The latter would give you the best way to make sure it only gets run locally.)
Anyway, limiting access to something on a web server is usually done via access controls in the web server, for example Apache has .htaccess files, e.g. the Allow directive (combined with Order and Deny).
Another possibility might be to check $ENV{REMOTE_ADDR} in your script, but then your script would be taking over the job that the web server normally does, and personally I'd try not to rely on the CGI environment variables too much.
In reply to Re: prevent perl script running from browser
by haukex
in thread prevent perl script running from browser
by snowchild
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |