<pre name="code" class="sql"><pre name="code" class="sql"> get($url)
The get() function will fetch the document identified by the given URL and return it. It returns "undef" if it fails. The $url argument can be either a simple string
or a reference to a URI object.
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).
get() 函数会获取给定的URL 的内容, 它返回"undef"如果失败的话, $url 参数可以使一个简单的字符串 或者是一个URL 对象的引用
你不能校验 响应码 或者响应header(like ’Content-Type’),当你接收web使用这个函数的时候,如果你需要这些信息 你需要使用( LWP::UserAgent).
[root@dr-mysql01 test]# cat e1.pl
use LWP::Simple;
$a=get('http://zjcap.cn');
print "\$a is $a\n";
head($url)
Get document headers.
Perl LWP::Simple 提供的方法
最新推荐文章于 2024-02-29 19:40:09 发布