use WWW::Curl::Easy;
$curl->setopt(CURLOPT_HEADER,1);
$curl->setopt(CURLOPT_RETURNTRANSFER,1);
$curl->setopt(CURLOPT_URL,"http://foo.com/login.php");
$curl->setopt(CURLOPT_POSTFIELDS,"user=usertest&pass=passwdtest");
$curl->perform();
它将打印出这样的结果。 如何从执行函数获取输出到变量中?如何将WWW的输出:Curl :: Easy转换为Perl中的变量
HTTP/1.1 302实测值缓存控制: 无缓存,必重新验证到期日: 星期六,01月11日200 5时00分○○秒GMT 地点:cookiecheck = 1 内容类型:文本/ html日期:星期四,28 Apr 2011 09:15:57 GMT服务器: xxxx/0.1内容长度:0 连接:保持活动设置Cookie: auth = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx; expires =星期六,27-Apr-2013 09:15:57 GMT; path = /;域= .foo.com中
谢谢