Skip to Main Content
Perl in a Nutshell
book

Perl in a Nutshell

by Nathan Patwardhan, Ellen Siever, Stephen Spainhour
December 1998
Beginner to intermediate content levelBeginner to intermediate
674 pages
40h 41m
English
O'Reilly Media, Inc.
Content preview from Perl in a Nutshell

Chapter 17. The LWP Library

LWP, the library for web access in Perl, is a bundle of modules that provide a consistent, object-oriented approach to creating web applications. The library, downloaded as the single file named libwww-perl, contains the following classes:

File

Parses directory listings.

Font

Handles Adobe Font Metrics.

HTML

Parses HTML files and converts them to printable or other forms.

HTTP

Provides client requests, server responses, and protocol implementation.

LWP

The core of all web client programs. It creates network connections and manages the communication and transactions between client and server.

URI

Creates, parses, and translates URLs.

WWW

Implements standards used for robots (automatic client programs).

Each module provides different building blocks that make up a whole web transaction—from connection, to request, to response and returned data. Each part is encapsulated by an object to give a standard interface to every web program you write. The following section gives an overview of how LWP works to create a web client.

LWP Overview

Any web transaction requires an application that can establish a TCP/IP network connection and send and receive messages using the appropriate protocol (usually HTTP). TCP/IP connections are established using sockets, and messages are exchanged via socket filehandles. See Chapter 13, for information on how to manually create socket applications. LWP provides an object for this application with LWP::UserAgent for clients; HTTP::Daemon ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Perl One-Liners

Perl One-Liners

Peteris Krumins
Beginning Perl

Beginning Perl

Curtis Ovid Poe
Mastering Perl

Mastering Perl

brian d foy
Perl Best Practices

Perl Best Practices

Damian Conway

Publisher Resources

ISBN: 1565922867Catalog PageErrata