Cgi question about different languages?

Status
Not open for further replies.

y0da

Wise, Aged Ars Veteran
127
Really simple question... is there any merits to different languages when programming CGI?
I read a post with someone saying C and CGI just don't mix? Why is that? I don't know very much about CGI so don't make the responses here too technical :)
Why is almost everything you see for CGI created in perl. Is there some disadvantage to using C++ or C versus perl or any other languages for that matter?
 

petrov

Ars Tribunus Militum
2,714
CGI deals almost entirely with untrusted data supplied by a possibly malicious attacker. You really, really want a safe language so you don't want to worry about memory management and buffer overflows. The second big advantage that perl has is the tainting mechanism, which prevents you from accidentally calling open() with a filename that looks like "file.html;cat /etc/passwd". You can still do it deliberately, but it's quite useful if you understand how it works and take advantage of the warnings it provides.

--sam
 
Status
Not open for further replies.