I would second the htaccess method unless you need to be more flexible about what the user is accessing, or in the event that you cannot restrict access to the current directory. The examples that I can think of would be:
- one cgi-bin, no subdirectories
- timeouts
- access to several items from the same url
- non-Apache webserver
- keeping everything in perl
...just my R$0.02 worth