通过perl的cgi程序去进行一个web操作:

一个简单的cgi例子:

1.HTML

<html>

<body>
<center>
<form name="input" action="cgi-bin/1.cgi">
<input type="submit" value="提交"/>
</form>
</center>
</body>
</html>
 

2.1.cgi

#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "<html><head><title>my first perl program</title></head>\n";
print "<body><h1>Hello world</h1></body></html>\n";