Network Programming with Perl

 
9780201615715: Network Programming with Perl

This is a superb book. Another splendid book from Lincoln, whose mastery and lucid exposition make this a must-have for the serious Perl programmer. --Jon Orwant, Chief Technology Officer, OReilly & Associates Founder of The Perl Journal, author of Mastering Algorithms with Perl, (OReilly & Associates)and co-author of Programming Perl, Third Edition (OReilly & Associates) Network Programming with Perl is a comprehensive, example-rich guide to creating network-based applications using the Perl programming language. Among its many capabilities, modern Perl provides a straightforward and powerful interface to TCP/IP, and this book shows you how to leverage these capabilities to create robust, maintainable, and efficient custom client/server applications. The book quickly moves beyond the basics to focus on high-level, application programming concepts, tools, and techniques. Readers will find a review of basic networking concepts and Perl fundamentals, including Perls I/O functions, process model, and object-oriented extensions. In addition, the book examines a collection of the best third-party modules in the Comprehensive Perl Archive Network, including existing network protocols f

Le informazioni nella sezione "Riassunto" possono far riferimento a edizioni diverse di questo titolo.

Review:

"Network programming"--the term had a distinct meaning once, but now it begs the question, "Is there another kind?" That's why Lincoln Stein's Network Programming with Perl is valuable. It shows how one of the world's top Perl authorities brings the language to bear on problems that require communication among computers, showing that you may not have to resort to Java as soon as you may have thought to meet a networking requirement. What's more, Stein doesn't assume you have a lot of Perl expertise. An intermediate-level familiarity with the language should enable you to understand the examples in the book and follow its classic code-and-commentary structure.

Stein presents full, working scripts, calling attention to particularly interesting lines and passages by repeating them in the text. If a program makes use of an unusual or previously undiscussed function (and lots of them do, because one of the author's missions is to introduce the contents of specialized libraries), its syntax and legal parameters will be documented and a concise statement of its behavior provided. The example programs are the best part of this book, though. As the problems get more complicated, it's fun to watch Stein solve them with efficient, attractive code. Unless you're a really experienced professional, you'll be able to study the examples in this book and learn a lot. --David Wall

Topics covered:

  • Perl function libraries and techniques that allow programs to interact with resources over a network
  • IO::Socket library
  • Net::FTP library
  • Net::Telnet library
  • Net::SMTP library
  • Chat problems
  • Internet Message Access Protocol (IMAP) issues
  • Markup-language parsing
  • Internet Protocol (IP) broadcasting and multicasting

From the Inside Flap:

The network is everywhere. At the office, machines are wired together into local area networks, and the local networks are interconnected via the Internet. At home, personal computers are either intermittently connected to the Internet, or, increasingly, "always-on" cable and DSL modems. New wireless technologies, such as Bluetooth, promise to vastly expand the network realm, embracing everything from cell phones to kitchen appliances. Such an environment creates tremendous opportunities for innovation. Whole new classes of applications are now predicated on the availability of high-bandwidth, always-on connectivity. Interactive games allow players from around the globe to compete on virtual playing fields and the instant messaging protocols let them broadcast news of their triumphs to their friends. New peer-to-peer systems, such as Napster and Gnutella, allow people to directly exchange MP3 audio files and other types of digital content. The SETI@Home project takes advantage of idle time on the millions of personal computers around the world to search for signs of extraterrestrial life in a vast collection of cosmic noise. The ubiquity of the network allows for more earthbound applications as well. With the right knowledge, you can write a robot that will fetch and summarize prices from competitors' Web sites; a script to page you when a certain stock drops below a specified level; a program to generate daily management reports and send them off via e-mail; a server that centralizes some number-crunching task on a single high-powered machine, or alternatively distributes that task among the multiple nodes of a computer cluster. Whether you are searching for the best price on a futon or for life in a distant galaxy, you'll need to understand how network applications work in order to take full advantage of these opportunities. You'll need a working understanding of the TCP/IP protocol--the common denominator for all Internet-based communications and the most common protocol in use in local area networks as well. You'll need to know how to connect to a remote program, to exchange data with that program, and what to do when something goes wrong. To work with existing applications, such as Web servers, you'll have to understand how the application-level protocols are built on top of TCP/IP, and how to deal with common data exchange formats such as XML and MIME. This book uses the Perl programming language to illustrate how to design and implement practical network applications. Perl is an ideal language for network programming for a number of reasons. First, like the rest of the language, Perl's networking facilities were designed to make the easy things easy. It takes just two lines of code to open a network connection to a server somewhere on the Internet and send it a message. A fully capable Web server can be written in a few dozen lines of code. Second, Perl's open architecture has encouraged many talented programmers to contribute to an ever-expanding library of useful third-party modules. Many of these modules provide powerful interfaces to common network applications. For example, after loading the LWP::Simple module, a single function call allows you to fetch the contents of a remote Web page and store it in a variable. Other third-party modules provide intuitive interfaces to e-mail, FTP, net news, and a variety of network databases. Perl also provides impressive portability. Most of the applications developed in this book will run without modification on UNIX machines, Windows boxes, Macintoshes, VMS systems, and OS/2. However, the most compelling reason to choose Perl for network application development is that it allows you to fully exploit the power of TCP/IP. Perl provides you with full access to the same low-level networking calls that are available to C programs and other natively compiled languages. You can create multicast applications, implement multiplexed servers, and design peer-to-peer systems. Using Perl, you can rapidly prototype new networking applications and develop interfaces to existing ones. Should you ever need to write a networking application in C or Java, you'll be delighted to discover how much of the Perl API carries over into these languages.

This Book's Audience Network Programming with Perl is written for novice and intermediate Perl programmers. I assume you know the basics of Perl programming, including how to write loops, how to construct if-else statements, how to write regular expression pattern matches, the concept of the automatic $_ variable, and the basics of arrays and hashes. You should have access to a Perl interpreter and some experience writing, running, and debugging scripts. Just as important, you should have access to a computer that is connected both to a local area network and to the Internet! Although the recipes in Chapter 10 on setting Perl-based network servers to start automatically when a machine is booted do require superuser (administrative) access, none of the other examples require privileged access to a machine.

This book does take advantage of the object-oriented features in Perl version 5 and higher, but most chapters do not assume a deep knowledge of this system. Chapter 1 addresses all the details you will need as a casual user of Perl objects.

This book is a thorough review of the TCP/IP protocol at the lowest level, or a guide to installing and configuring network hubs, routers, and name servers. Many good books on the mechanics of the TCP/IP protocol and network administration are listed in the references in Appendix D. Roadmap This book is organized into four main parts, Basics, Developing Cients for Common Services, Developing TCP Client/Server Systems, and Advanced Topics. Part I, Basics, introduces the fundamentals of TCP/IP network communications.

Chapters 1 and 2, Networking Basics and Processes, Pipes, and Signals, review Perl's functions and variables for input and output, discuss the exceptions that can occur during I/O operations, and use the piped filehandle as the basis for introducing sockets. These chapters also review Perl's process model, including signals and forking, and introduce Perl's object-oriented extensions. Chapter 3, Introduction to Berkeley Sockets, discusses the basics of Internet networking and describes IP addresses, network ports, and the principles of client/server applications. It then turns to the Berkeley Socket API, which provides the programmer's interface to TCP/IP. Chapters 4 and 5, The TCP Protocol and The IO::Socket API and Simple TCP Applications, show the basics of TCP, the networking protocol that provides reliable stream-oriented communications. These chapters demonstrate how to create client and server applications and then introduce examples that show the power of technique as well as some common roadblocks.

Part II, Developing Clients for Common Services, looks at a collection of the best third-party modules that developers have contributed to the Comprehensive Perl Archive Network (CPAN).

Chapter 6, FTP and Telnet, introduces modules that provide access to the FTP file-sharing service, as well as to the flexible Net::Telnet module which allows you to create clients to access all sorts of network services. E-mail is still the dominant application on the Internet, and Chapter 7, SMTP: Sending Mail, introduces half of the equation. This chapter shows you how to create e-mail messages on the fly, including binary attachments, and send them to their destinations. Chapter 8, POP, IMAP, and NNTP: Processing Mail and Netnews, covers the other half of e-mail, explaining modules that make it possible to receive mail from mail drop systems and process their contents, including binary attachments. Chapter 9, Web Clients, discusses the LWP module, which provides everything you need to talk to Web servers, download and process HTML documents, and parse XML.

Part III, Developing TCP Client/Server Systems--the longest part of the book--discusses the alternatives for designing TCP-based client/server systems. The major example used in these chapters is an interactive psychotherapist server, based on Joseph Weizenbaum's classic Eliza program.

Chapter 10, Forking Servers and the inetd Daemon, covers the common type of TCP server that forks a new process to handle each incoming connection. This chapter also covers the UNIX and Windows inetd daemons, which allow programs not specifically designed for networking to act as servers. Chapter 11, Multithreaded Applications, explains Perl's experimental multithreaded API, and shows how it can greatly simplify the design of TCP clients and servers. Chapters 12 and 13, Multiplexed Operations and Nonblocking I/O, discuss the select() call, which enables an application to process multiple I/O streams concurrently without using multiprocessing or multithreading. Chapter 14, Bulletproofing Servers, discusses techniques for enhancing the reliability and maintainability of network servers. Among the topics are logging, signal handling, and exceptions, as well as the important topic of network security. Chapter 15, Preforking and Prethreading, presents the forki

Le informazioni nella sezione "Su questo libro" possono far riferimento a edizioni diverse di questo titolo.

I migliori risultati di ricerca su AbeBooks

1.

Stein, Lincoln D.
Editore: Prentice Hall
ISBN 10: 0201615711 ISBN 13: 9780201615715
Nuovi Quantità: > 20
Da
INDOO
(Avenel, NJ, U.S.A.)
Valutazione libreria
[?]

Descrizione libro Prentice Hall. Condizione libro: New. Brand New. Codice libro della libreria 0201615711

Maggiori informazioni su questa libreria | Fare una domanda alla libreria

Compra nuovo
EUR 37,78
Convertire valuta

Aggiungere al carrello

Spese di spedizione: EUR 3,04
In U.S.A.
Destinazione, tempi e costi

2.

Stein, Lincoln D.
Editore: Addison-Wesley Professional (2001)
ISBN 10: 0201615711 ISBN 13: 9780201615715
Nuovi Paperback Quantità: 2
Da
Murray Media
(North Miami Beach, FL, U.S.A.)
Valutazione libreria
[?]

Descrizione libro Addison-Wesley Professional, 2001. Paperback. Condizione libro: New. Codice libro della libreria P110201615711

Maggiori informazioni su questa libreria | Fare una domanda alla libreria

Compra nuovo
EUR 45,00
Convertire valuta

Aggiungere al carrello

Spese di spedizione: EUR 2,59
In U.S.A.
Destinazione, tempi e costi

3.

Lincoln D. Stein
Editore: Addison-Wesley Professional (2001)
ISBN 10: 0201615711 ISBN 13: 9780201615715
Nuovi Paperback Quantità: 1
Da
Irish Booksellers
(Rumford, ME, U.S.A.)
Valutazione libreria
[?]

Descrizione libro Addison-Wesley Professional, 2001. Paperback. Condizione libro: New. book. Codice libro della libreria 0201615711

Maggiori informazioni su questa libreria | Fare una domanda alla libreria

Compra nuovo
EUR 47,73
Convertire valuta

Aggiungere al carrello

Spese di spedizione: GRATIS
In U.S.A.
Destinazione, tempi e costi

4.

Lincoln D. Stein
Editore: Addison-Wesley Professional (2001)
ISBN 10: 0201615711 ISBN 13: 9780201615715
Nuovi Paperback Quantità: 1
Da
Ergodebooks
(RICHMOND, TX, U.S.A.)
Valutazione libreria
[?]

Descrizione libro Addison-Wesley Professional, 2001. Paperback. Condizione libro: New. 1. Codice libro della libreria DADAX0201615711

Maggiori informazioni su questa libreria | Fare una domanda alla libreria

Compra nuovo
EUR 47,43
Convertire valuta

Aggiungere al carrello

Spese di spedizione: EUR 3,46
In U.S.A.
Destinazione, tempi e costi

5.

Lincoln D. Stein
Editore: Addison-Wesley Professional (2001)
ISBN 10: 0201615711 ISBN 13: 9780201615715
Nuovi Brossura Quantità: > 20
Da
Palexbooks
(Sanford, NC, U.S.A.)
Valutazione libreria
[?]

Descrizione libro Addison-Wesley Professional, 2001. Condizione libro: New. Brand new! Please provide a physical shipping address. Codice libro della libreria 9780201615715

Maggiori informazioni su questa libreria | Fare una domanda alla libreria

Compra nuovo
EUR 64,47
Convertire valuta

Aggiungere al carrello

Spese di spedizione: EUR 2,60
In U.S.A.
Destinazione, tempi e costi

6.

Stein, Lincoln
Editore: Addison-Wesley (2000)
ISBN 10: 0201615711 ISBN 13: 9780201615715
Nuovi Paperback Quantità: 1
Da
Revaluation Books
(Exeter, Regno Unito)
Valutazione libreria
[?]

Descrizione libro Addison-Wesley, 2000. Paperback. Condizione libro: Brand New. 1st edition. 784 pages. 9.00x7.25x1.50 inches. In Stock. Codice libro della libreria 0201615711

Maggiori informazioni su questa libreria | Fare una domanda alla libreria

Compra nuovo
EUR 73,68
Convertire valuta

Aggiungere al carrello

Spese di spedizione: EUR 6,78
Da: Regno Unito a: U.S.A.
Destinazione, tempi e costi

7.

Stein Lincoln D.
Editore: Longman Group
ISBN 10: 0201615711 ISBN 13: 9780201615715
Nuovi Quantità: 2
Da
Majestic Books
(London, ,, Regno Unito)
Valutazione libreria
[?]

Descrizione libro Longman Group. Condizione libro: New. pp. 784. Codice libro della libreria 7569889

Maggiori informazioni su questa libreria | Fare una domanda alla libreria

Compra nuovo
EUR 94,74
Convertire valuta

Aggiungere al carrello

Spese di spedizione: EUR 6,22
Da: Regno Unito a: U.S.A.
Destinazione, tempi e costi

8.

Lincoln Stein
ISBN 10: 0201615711 ISBN 13: 9780201615715
Nuovi Quantità: 1
Da
Castle Rock
(Pittsford, NY, U.S.A.)
Valutazione libreria
[?]

Descrizione libro Condizione libro: Brand New. Book Condition: Brand New. Codice libro della libreria 97802016157151.0

Maggiori informazioni su questa libreria | Fare una domanda alla libreria

Compra nuovo
EUR 108,25
Convertire valuta

Aggiungere al carrello

Spese di spedizione: EUR 3,46
In U.S.A.
Destinazione, tempi e costi