【发布时间】:2013-12-23 07:49:30
【问题描述】:
我正在尝试将此 shell 命令转换为我正在使用的 perl 使用 WWW::Curl::Easy;
我想将详细信息写入另一个文件,并且我想将 URL 内容放入另一个文件中。到目前为止,我已经能够卷曲 URL 并向其添加标题。
现在我只想将 as shell 命令提到的 1> 输出写入文件,然后
2> 到 antohter 文件中,因为它在 shell 中
my $curl = WWW::Curl::Easy->new();
$curl->setopt(CURLOPT_HEADER,1);
$curl->pushopt(WWW::Curl::Easy::CURLOPT_HTTPHEADER,['AUTH_USER:John']);
$curl->setopt(WWW::Curl::Easy::CURLOPT_URL,"www.abc.com");
$curl->setopt(CURLOPT_VERBOSE,1);
www.abc.com 的内容怎么放
<html>
<body>
<marquee>abc is up </marquee>
</body>
</html>
合并到一个文件中
然后这个放到另一个文件中
> GET / HTTP/1.1
Host: abc-01
Accept: */*
AUTH_USER:hojn
< HTTP/1.1 200 OK
......
【问题讨论】:
标签: perl shell curl libcurl filehandle