Why can't I fetch www.google.com with Perl's LWP::Simple?

前端 未结 4 574
长情又很酷
长情又很酷 2021-01-26 09:00

I cant seem to get this peice of code to work:

    $self->{_current_page} = $href;
    my $response = $ua->get($href);
    my $responseCode = $response->         


        
4条回答
  •  无人共我
    2021-01-26 09:50

    Here's your problem:

    my $content = LWP::Simple->get($href);
    

    That passes the string "LWP::Simple" as the first argument to 'get'. You want:

    my $content = LWP::Simple::get($href);
    

提交回复
热议问题