# Note that if you do this, you must explicitly
# export everything you want to use:
use LWP::Simple qw($ua get);
$ua->timeout(30);
my $html = get $webpage || die "Timed out!";
####
$ua->agent('My agent/1.0');
##
##
use LWP::Simple qw($ua get);
use HTTP::Cookies;
$ua->cookie_jar(HTTP::Cookies->new);
get $webpage . $login_string;
my $logged_in_page = get $webpage . $private_page;
##
##
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
$ua->timeout(30);
$request = HTTP::Request->new('GET', $webpage);
$response = $ua->request($request);
my $html = $response->content;
##
##
perl -MLWP::Simple -e "getprint 'http://perlmonks.org?node_id=145587'"
perl -MLWP::Simple -e "getprint 'http://perlmonks.org?node=showchatmessages&displaytype=raw'"
##
##
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 command line!'"
##
##
my $words = 'LWP::Simple tutorial'
my $html = get "http://www.perlmonks.org/index.pl?node=$words";
##
##
my $response_code = mirror $webpage, 'webpage.html';
die "Bad response $response_code" unless is_success($response_code);
##
##
use LWP::Simple;
print "$webpage exists and server is up!\n" if (head($webpage));
##
##
my @headers = head $webpage;
print join "\n", @headers;