Chapter 9. Web Clients


 
Network Programming with Perl
By Lincoln  D.  Stein
Slots : 1
Table of Contents
Part 2:   Developing Clients for Common Services

    Content

In the previous chapters we reviewed client modules for sending and receiving Internet mail, transferring files via FTP, and interacting with Netnews servers. In this chapter we look at LWP, the Library for Web access in Perl. LWP provides a unified API for interacting with Web, FTP, News and Mail servers, as well as with more obscure services such as Gopher.

With LWP you can (1) request a document from a remote Web server using its URL; (2) POST data to a Web server, emulating the submission of a fill-out form; (3) mirror a document on a remote Web server in such a way that the document is transferred only if it is more recent than the local copy; (4) parse HTML documents to recover links and other interesting features; (5) format HTML documents as text and postscript; and (6) handle cookies, HTTP redirects, proxy servers, and HTTP user authentication. Indeed, LWP implements all the functionality one needs to write a Web browser in Perl, and if you download and install the Perl-TK distribution, you'll find it contains a fully functional graphical Web browser written on top of LWP.

The base LWP distribution contains 35 modules, and another dozen modules are required for HTML parsing and formatting. Because of its size and scope, we will skim the surface of LWP. For an exhaustive treatment, see LWP's POD documentation, or the excellent , but now somewhat dated Web Client Programming with Perl [Wong 1999].


   
Top


Network Programming with Perl
Network Programming with Perl
ISBN: 0201615711
EAN: 2147483647
Year: 2000
Pages: 173

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net