.\" Automatically generated by Pod::Man 2.1801 (Pod::Simple 3.05) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "IO::All::LWP 3pm" .TH IO::All::LWP 3pm "2007-03-29" "perl v5.10.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" IO::All::LWP \- IO::All interface to LWP .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use IO::All; \& \& "hello world\en" > io(\*(Aqftp://localhost/test/x\*(Aq); # save to FTP \& $content < io(\*(Aqhttp://example.org\*(Aq); # GET webpage \& \& io(\*(Aqhttp://example.org\*(Aq) > io(\*(Aqindex.html\*(Aq); # save webpage .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module acts as glue between IO::All and \s-1LWP\s0, so that files can be read and written through the network using the convenient interface. Note that this module is not \f(CW\*(C`use\*(C'\fRd directly: you just use IO::All, which knows when to autoload IO::All::HTTP, IO::All::HTTPS, IO::All::FTP, or IO::All::Gopher, which implement the specific protocols based on IO::All::LWP. .SH "EXECUTION MODEL" .IX Header "EXECUTION MODEL" \&\fB\s-1GET\s0 requests\fR. When the IO::All object is opened, the \s-1URI\s0 is fetched and stored by the object in an internal file handle. It can then be accessed like any other file via the IO::All methods and operators, it can be tied, etc. .PP \&\fB\s-1PUT\s0 requests\fR. When the IO::All object is opened, an internal file handle is created. It is possible to that file handle using the various IO::All methods and operators, it can be tied, etc. If \f(CW$io\fR\->put is not called explicitly, when the IO::All object is closed, either explicitly via \f(CW$io\fR\->close or automatically upon destruction, the actual \s-1PUT\s0 request is made. .PP The bad news is that the whole file is stored in memory after getting it or before putting it. This may cause problems if you are dealing with multi-gigabyte files! .SH "METHODS" .IX Header "METHODS" The simplest way of doing things is via the overloaded operators > and <, as shown in the \s-1SYNOPSIS\s0. These take care of automatically opening and closing the files and connections as needed. However, various methods are available to provide a finer degree of control. .PP This is a subclass of IO::All. In addition to the inherited methods, the following methods are available: .IP "\(bu" 4 ua .Sp Set or get the user agent object (LWP::UserAgent or a subclass). If called with a list, the list is passed to LWP::UserAgent\->new. If called with an object, the object is used directly as the user agent. Note that there is a default user agent if no user agent is specified. .IP "\(bu" 4 uri .Sp Set or get the \s-1URI\s0. It can take either a \s-1URI\s0 object or a string, and it returns an \s-1URI\s0 object. Note that calling this method overrides the user and password fields, because URIs can contain authentication information. .IP "\(bu" 4 user .Sp Set or get the user name for authentication. Note that the user name (and the password) can also be set as part of the \s-1URL\s0, as in \&\*(L"http://me:secret@example.com/\*(R". .IP "\(bu" 4 password .Sp Set or get the password for authentication. Note that the password can also be set as part of the \s-1URL\s0, as discussed above. .IP "\(bu" 4 get .Sp \&\s-1GET\s0 the current \s-1URI\s0 using \s-1LWP\s0. Or, if called with an HTTP::Request object as a parameter, it does that request instead. It returns the HTTP::Response object. .IP "\(bu" 4 put .Sp \&\s-1PUT\s0 to the current \s-1URI\s0 using \s-1LWP\s0. If called with an HTTP::Request object, it does that request instead. If called with a scalar, it PUTs that as the content to the current \s-1URI\s0, instead of the current accumulated content. .IP "\(bu" 4 response .Sp Return the HTTP::Response object. .IP "\(bu" 4 request .Sp Does an \s-1LWP\s0 request. It requires an HTTP::Request object as a parameter. Returns an HTTP::Response object. .IP "\(bu" 4 open .Sp Overrides the \f(CW\*(C`open\*(C'\fR method from IO::All. It takes care of GETting the content, or of setting up the internal buffer for PUTting. Just like the \&\f(CW\*(C`open\*(C'\fR method from IO::All, it can take a mode: '<' for \s-1GET\s0 and \&'>' for \s-1PUT\s0. .IP "\(bu" 4 close .Sp Overrides the \f(CW\*(C`close\*(C'\fR method from IO::All. It takes care of PUTting the content. .SH "DEPENDENCIES" .IX Header "DEPENDENCIES" This module uses \s-1LWP\s0 for all the heavy lifting. It also requires perl\-5.8.0 or a more recent version. .SH "SEE ALSO" .IX Header "SEE ALSO" IO::All, \s-1LWP\s0, IO::All::HTTP, IO::All::FTP. .SH "AUTHORS" .IX Header "AUTHORS" Ivan Tubert-Brohman and Brian Ingerson .PP Thanks to Sergey Gleizer for the ua method. .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (c) 2007. Ivan Tubert-Brohman and Brian Ingerson. All rights reserved. .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .PP See