in reply to PHP to CGI

Can someone help me write this for CGI?

Please note that CGI is not a programming language. CGI is an interface. Anything can run as a CGI -- a Perl program, a C program, a Bash shell script, or even a PHP script. Saying "help me write this for CGI" is quite ambiguous and not very helpful.

If you have a specific question about doing something CGI-related in Perl, we're all ears, but something overly broad and not very well-researched is likely to be ignored, or even worse, scorned.