Из предисловия автора What´s in This Book
The first quarter of the book addresses Perl´s basic data types, spread over five chapters. Chapter 1, Strings, covers matters like accessing substrings, expanding function calls in strings, and parsing comma-separated data. Chapter 2, Numbers, tackles oddities of floating point representation, placing commas in numbers, and pseudo-random numbers. Chapter 3, Dates and Times, demonstrates conversions between numeric and string date formats and using timers. Chapter 4, Arrays, covers everything relating to list and array manipulation, including finding unique elements in a list, efficiently sorting lists, and randomizing them. Chapter 5, Hashes, concludes the basics with a demonstration of the most useful data type, the associative array. The chapter shows how to access a hash in insertion order, how to sort a hash by value, and how to have multiple values per key.
Chapter 6, Pattern Matching, is by far the largest chapter. Recipes include converting a shell wildcard into a pattern, matching letters or words, matching multiple lines, avoiding greediness, and matching strings that are close to but not exactly what you´re looking for. Although this chapter is the longest in the book, it could easily have been longer still - every chapter contains uses of regular expressions. It´s part of what makes Perl Perl.
The next three chapters cover the filesystem. Chapter 7, File Access, shows opening files, locking them for concurrent access, modifying them in place, and storing filehandles in variables. Chapter 8, File Contents, discusses watching the end of a growing file, reading a particular line from a file, and random access binary I/O. Finally, in Chapter 9, Directories, we show techniques to copy, move, or delete a file, manipulate a file´s timestamps, and recursively process all files in a directory.
Chapters 10 through 13 focus on making your program flexible and powerful. Chapter 10, Subroutines, includes recipes on creating persistent local variables, passing parameters by reference, calling functions indirectly, and handling exceptions. Chapter 11, References and Records, is about data structures; basic manipulation of references to data and functions are demonstrated. Later recipes show how to create record-like data structures and how to save and restore these structures from permanent storage. Chapter 12, Packages, Libraries, and Modules, concerns breaking up your program into separate files; we discuss how to make variables and functions private to a module, replace built-ins, trap calls to missing modules, and use the h2ph and h2xs tools to interact with C and C++ code. Lastly, Chapter 13, Classes, Objects, and Ties, covers the fundamentals of building your own object-based module to create user-defined types, complete with constructors, destructors, and inheritance. Other recipes show examples of circular data structures, operator overloading, and tied data types.
The next two chapters are about interfaces: one to databases, the other to display devices. Chapter 14, Database Access, includes techniques for manipulating indexed text files, locking DBM files and storing data in them, and a demonstration of Perl´s SQL interface. Chapter 15, User Interfaces, covers topics such as clearing the screen, processing command-line switches, single-character input, moving the cursor using termcap and curses, and platform independent graphical programming using Tk.
The last quarter of the book is devoted to interacting with other programs and services. Chapter 16, Process Management and Communication, is about running other programs and collecting their output, handling zombie processes, named pipes, signal management, and sharing variables between running programs. Chapter 17, Sockets, shows how to establish stream connections or use datagrams to create low-level networking applications for client-server programming. Chapter 18, Internet Services, is about higher-level prot
Perl Cookbook; Tom Christiansen & Nathan Torkington; ISBN 1-56592-243-3, 794 pages
На английском языке, в формате HTML