第2个回答 2012-02-28
Now let's modify hello.pl so it will run as a CGI script. Every CGI script needs to output a special header as the first thing the script outputs. This header line is checked by the Web server, then passed on to the remote user invoking the script in order to tell that user's browser what type of file to expect. Most of the time, your script is going to output an HTML file, which means you'll need to output the following header:
print "Content-type: text/html\n\n";
这只是一个文件头而已,告诉浏览器,我传过来的是HTML格式的文件。