参考文章:
http://www.jb200.com/article/4403.html
http://www.willmaster.com/library/manage-forms/using_perl_to_submit_a_form.php
有时,需要在perl中非交互地调用已有的cgi来完成一定的功能,此时需要模拟一个http请求来调用cgi。
get方式调用:
post方式调用:
文件:cgireader.cgi
#!/usr/local/bin/perl
use CGI;
$co = new CGI;
print $co->header,
$co->start_html(
-title=>'CGI Example',
-author=>'yourName',
-BGCOLOR=>'white',
-LINK=>'red'
);
if ($co->param()) {
print
"You entered this text: ",
$co->em($co->param('text1')),
" ",
$co->em($co->param('text2')),
".";
} else {
print "Sorry, I did not see any text.";
}
print $co->end_html;
作者:iTech
出处:http://itech.cnblogs.com/