- or download this
# Note that if you do this, you must explicitly
# export everything you want to use:
...
$ua->timeout(30);
my $html = get $webpage || die "Timed out!";
- or download this
$ua->agent('My agent/1.0');
- or download this
use LWP::Simple qw($ua get);
use HTTP::Cookies;
...
get $webpage . $login_string;
my $logged_in_page = get $webpage . $private_page;
- or download this
use LWP::UserAgent;
...
$response = $ua->request($request);
my $html = $response->content;
- or download this
perl -MLWP::Simple -e "getprint 'http://perlmonks.org?node_id=145587'"
perl -MLWP::Simple -e "getprint 'http://perlmonks.org?node=showchatmes
+sages&displaytype=raw'"
- or download this
perl -MLWP::Simple -e "get 'http://perlmonks.org?op=login&user=Dog and
+ Pony&passwd=doNotUseThisPW&op=message&message=Hi it is me on the com
+mand line!'"
- or download this
my $words = 'LWP::Simple tutorial'
my $html = get "http://www.perlmonks.org/index.pl?node=$words";
- or download this
my $response_code = mirror $webpage, 'webpage.html';
die "Bad response $response_code" unless is_success($response_code);
- or download this
use LWP::Simple;
print "$webpage exists and server is up!\n" if (head($webpage));
- or download this
my @headers = head $webpage;
print join "\n", @headers;