From ef5588c38176cafa36b1cd8d62c3e48387f6ab29 Mon Sep 17 00:00:00 2001 From: Gisle Aas Date: Tue, 28 Aug 2001 04:53:53 +0000 Subject: [PATCH] New synopsis as suggested by "Sean M. Burke" --- lib/LWP/UserAgent.pm | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/LWP/UserAgent.pm b/lib/LWP/UserAgent.pm index 793114983..0e201bea3 100644 --- a/lib/LWP/UserAgent.pm +++ b/lib/LWP/UserAgent.pm @@ -1,4 +1,4 @@ -# $Id: UserAgent.pm,v 1.92 2001/08/28 04:37:52 gisle Exp $ +# $Id: UserAgent.pm,v 1.93 2001/08/28 04:53:53 gisle Exp $ package LWP::UserAgent; use strict; @@ -10,13 +10,17 @@ LWP::UserAgent - A WWW UserAgent class =head1 SYNOPSIS require LWP::UserAgent; - $ua = LWP::UserAgent->new(env_proxy => 1, - keep_alive => 1, - timeout => 30, - ); + my $ua = LWP::UserAgent->new(env_proxy => 1, + keep_alive => 1, + timeout => 30, + ); - $request = HTTP::Request->new('GET', 'file://localhost/etc/motd'); + $response = $ua->get('http://search.cpan.org/'); + # or: + + $request = HTTP::Request->new('GET', 'http://search.cpan.org/'); + # and then one of these: $response = $ua->request($request); # or $response = $ua->request($request, '/tmp/sss'); # or $response = $ua->request($request, \&callback, 4096); @@ -95,7 +99,7 @@ use vars qw(@ISA $VERSION); require LWP::MemberMixin; @ISA = qw(LWP::MemberMixin); -$VERSION = sprintf("%d.%02d", q$Revision: 1.92 $ =~ /(\d+)\.(\d+)/); +$VERSION = sprintf("%d.%02d", q$Revision: 1.93 $ =~ /(\d+)\.(\d+)/); use HTTP::Request (); use HTTP::Response ();