-----------------------------------------
#!/usr/local/bin/perl
print "Location: http://www.example.com\n\n";
-----------------------------------------
Is that enough? Am I missing something important? I would also like to implement a counter, so I can keep track of how many people access the redirect. How do I do that?
The only other thing you may want to do here first is send out the correct header status if this is a permanent redirect. By nature, I believe this is going to be a 302 or temporary redirect. If you want a 301 permanent being sent off, you'll want to send off your own header first.