此代码中类的元素是什么response
:或者,我如何打印整个对象response
?
#!/usr/bin/env perl
# Example code from Chapter 1 of /Perl and LWP/ by Sean M. Burke
# http://www.oreilly.com/catalog/perllwp/
# [email protected]
require 5;
use strict;
use warnings;
use LWP;
my $browser = LWP::UserAgent->new();
my $response = $browser->get("http://www.oreilly.com/");
die "Couldn't access it: ", $response->status_line
unless $response->is_success;
print $response->header("Server"), "\n";
__END__
像这样,如果你想获取内容
HTML
:或者,如果您想从字面上获取
$res
内容对象以供检查: