“get” not working in perl

前端 未结 1 1014
情话喂你
情话喂你 2021-01-28 05:14

I\'m new to perl. In the past few days, I\'ve made some simple scripts that save websites\' source codes to my computer via \"get.\" They do what they\'re supposed to, but will

相关标签:
1条回答
  • 2021-01-28 05:46

    http://p3rl.org/LWP::Simple#get:

    The get() function will fetch the document identified by the given URL and return it. It returns undef if it fails. […]

    You will not be able to examine the response code or response headers (like 'Content-Type') when you are accessing the web using this function. If you need that information you should use the full OO interface (see LWP::UserAgent).

    You really need better error reporting, switch to the LWP::UserAgent library. I suspect the forum software blocks the LWP user agent.

    0 讨论(0)
提交回复
热议问题