1

我有一个正在为学校工作的项目,但我似乎在这里遇到了错误......

我在第 5 行收到“无法在未定义的值上调用方法‘内容’”

use LWP::Simple;
for(my $id=0;$id<55;$id++)
{
    my $response = get("http://www.gamereplays.org/community/index.php?act=medals&CODE=showmedal&MDSID=" + $id );
    my $content = $response->content;    
        for(my $id2=0;$id2<10;$id2++)
        {
                $content =~ /<img src="http:\/\/www\.gamereplays.org\/community\/style_medals\/(.*)$id2\.gif" alt=""\/>/;
                $url = "http://www.gamereplays.org/community/style_medals/" . $1 . $id2 . ".gif";
                getstore($url, $1 . $id2 . ".gif");

        }
}
4

1 回答 1

3

LWP::simple 不返回响应对象,它直接返回包含响应正文的字符串。并且您在每个请求之间暂停一下,以避免冲击目标网站。

于 2011-01-12T05:32:19.313 回答