|
Perl @ Web Programming
Programming Shed : Programmer Store & Resources |
|
|
|
Perl Index - Perl Book : Network Programming with Perl
by Lincoln D. Stein Paperback: 576 pages Dimensions (in inches): 1.42 x 9.23 x 7.37 Publisher: Addison-Wesley Pub Co ISBN: 0201615711; 1st edition (December 29, 2000) "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. Topics in Network Programming with Perl 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 Book Info: (Pearson Education) A text focusing on the methods and alternatives for designed TCP/IP-based client/server systems and advanced techniques for specialized applications with Perl. A guide examining a collection of the best third party modules in the Comprehensive Perl Archive Network. DLC: Perl (Computer program language). 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 From the Back Cover: "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, O'Reilly & Associates Founder of The Perl Journal, author of Mastering Algorithms with Perl, (O'Reilly & Associates) and co-author of Programming Perl, Third Edition (O'Reilly & 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 Perl's 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 for e-mail, news, and the Web. The core of the book focuses on methods and alternatives for designing TCP-based client/server systems and more advanced techniques for specialized applications. Specific topics covered include: • The Berkeley Sockets API • The TCP protocol and the IO::Socket API • FTP filesharing service • The Net::Telnet module for adapting clients to interactive network services • SMTP, including how to create and send e-mails with multimedia attachments • POP, IMAP, and NNTP for receiving and processing e-mail • HTTP and the LWP module for communicating with Web servers • Forking servers and the UNIX and Windows inetd daemons • Perl's experimental multithreaded API • Multiplexed operations and nonblocking I/O • Bulletproofing servers • TCP urgent data • UDP protocol and servers • Broadcasting and multicasting • Interprocess communication with UNIX-domain sockets Useful, working programs demonstrate ideas and techniques in action, including a real-time chat and messaging system, a program for processing e-mail containing MIME attachments, a program for mirroring an FTP site, and a Web robot. Network Programming with Perl focuses on TCP/IP rather than just the common Web protocols. Modeled after the critically acclaimed TCP/IP Illustrated by W. Richard Stevens, this book achieves a level of detail far superior to most. It is an essential resource for network administrators and Perl programmers who are creating network applications. About the Author: Lincoln Stein has an M.D. and is a scientist at Cold Spring Harbor Laboratory. When the Web first emerged, he created and maintained one of the earliest Internet sites for distribution of Human Genome Project data and has since become an acknowledged expert in Web, network, and Perl programming. Known for his exceptional ability to synthesize and present complex information, he writes for The Perl Journal and Web Techniques magazines and is the author of four other books. Customer Reviews Reviewer: Dave Hoover from Warrenville, IL United States As an intermediate Perl programmer and a relative newcomer to network programming, I found Part 1, The Basics, to be pure gold. Dr. Stein's easy-to-follow writing style helped me to finally understand elusive concepts like fork, pipes and sockets. As the book progresses, it gently builds into more and more advanced network topics. When I hit Part 4, Advanced Topics, I knew was in over my head. Yet, I now have a great reference for the future when I need/want to learn how to play with Broadcasting, UDP servers, etc. One of the most valuable aspects of this book is his coverage of such a multitude of Perl modules, helping the reader to understand the each of modules' basic API in a straightforward manner. This book is worth every cent. Reviewer: A reader from Reston, VA Lincoln Stein's latest book, "Network Programming with Perl", is a must-have text for anyone who is doing Perl network programming, or may be doing so in the near future. It reviews the basics of Perl I/O, explains the details of Perl's network functions, and covers the ever-evolving examples with line-by-line descriptions. From telnet, mail, ftp, and the Web, from Usenet News to custom services, this 650-page book covers any networking task currently known to man, and gives you the skills to manage the unknown tasks to come. Reviewer: sherzodr from Mt. Pleasant, MI USA This book has been in my wish list for pretty long time, and before I actually buy it decided to check it out of my school's library. Enjoyment started at the first chapters of the book that I read in the library's caffeteria. The book definitely covers all the aspects of the Network Progamming, not only with Perl, but in general as well. In the first chapters of the book, Lincoln Stein makes good use of such OO modules as IO::File and IO::Socket to demostrate that difference between local file operations and remote network programming isn't that much different at all ( at least in Perl ). Chapter 2 shows you several applications that are built on pipes. The best thing about the chapter was the signals part, where L. Stein shows examples, catching all sorts of signals that your progam receives and reacts accordingly. One example was reacting to pressing of CTRL+C sequence of keys to terminate the progam. I would call Chapter 3 the heart of the book, since it goes over Berkeley Sockets, the base for Network progamming in most systems, no matter what progamming language you tend to prefer. It also explains thoroughly Sockets Addressings, Network naming conventions, protocols, services and a lot more. This chapter, together with the Chapter 4 alone are worth the whole price of the book, I believe. The chapter in the end goes over some common netwook analysis tools, such as "nslookup", "ping", so on and so forth. Chapter 4 tells you all you need about TCP Protocol. Shows several examples as well. Goes over Adjusting Socket options, and their uses. Chapter 5 is not anything newer supposing you've been following all the pervious chapters. Untill this chapter, L. Stein demonstrates the coding using much low level Socket API. here Lincoln starts using IO::Socket's Object Oriented Interface for its handy functionalities that enable writing Networking applications more relieving. Chapters 6, 7, 8 and 9 takes you through writing several commong network clients such as SMTP/mailing clients, Telnet, FTP clients. Also provides their complete source codes in case you just feel likek copying them. Chapter 9 gets into the most fun part: LWP and HTML/XML Parsing. Spends good 50 pages on those. Very exciting indeed! The rest of the book (another half) is dedicated for writing Server applications, which I haven't read. I am sure the rest is as exciting as it's been up to this point. But no matter what, I am greatefull to the book for such an exciting and informative coverage of the topics. It's worth every penny that you spend on it. Buy it! Reviewer: Mark E. Diodati from Milwaukee, WI United States Everything you wanted to know about Perl and socket applications. Lincoln is very good about explaining all concepts and providing lots of examples. Lincoln is the author of the CGI.pm module. In addition, he wrote a book about CGI.pm that is the bible - a "must have" for anyone doing Perl CGI work. Lincoln is a great guy. He wrote a Perl module for Napster. I could not get it running on my Win32 system (my linux box was at work). Within an hour of sending him an email, he sent me a new module for Win32 that worked great. Lincoln did not even know who I was. |
|
|
© 2005-2006, Programming Shed
|