Learning Perl. 6th Edition - Helion
ISBN: 978-14-493-1314-2
stron: 388, Format: ebook
Data wydania: 2011-06-16
Księgarnia: Helion
Cena książki: 139,00 zł
If you're just getting started with Perl, this is the book you want—whether you're a programmer, system administrator, or web hacker. Nicknamed "the Llama" by two generations of users, this bestseller closely follows the popular introductory Perl course taught by the authors since 1991. This 6th edition covers recent changes to the language up to version 5.14.
Perl is suitable for almost any task on almost any platform, from short fixes to complete web applications. Learning Perl teaches you the basics and shows you how to write programs up to 128 lines long—roughly the size of 90% of the Perl programs in use today. Each chapter includes exercises to help you practice what you've just learned. Other books may teach you to program in Perl, but this book will turn you into a Perl programmer.
Topics include:
- Perl data and variable types
- Subroutines
- File operations
- Regular expressions
- String manipulation (including Unicode)
- Lists and sorting
- Process management
- Smart matching
- Use of third party modules
Osoby które kupowały "Learning Perl. 6th Edition", wybierały także:
- Perl. Mistrzostwo w programowaniu 44,00 zł, (22,00 zł -50%)
- Wielkie umysły programowania. Jak myślą i pracują twórcy najważniejszych języków 79,00 zł, (47,40 zł -40%)
- Learning Perl. Making Easy Things Easy and Hard Things Possible. 7th Edition 169,00 zł, (118,30 zł -30%)
- 100 sposobów na Perl 39,00 zł, (29,25 zł -25%)
- Mastering Perl. 2nd Edition 176,92 zł, (152,15 zł -14%)
Spis treści
Learning Perl. 6th Edition eBook -- spis treści
- Learning Perl
- Preface
- Typographical Conventions
- Code Examples
- Safari Books Online
- How to Contact Us
- History of This Book
- Changes from the Previous Edition
- Acknowledgments
- From Randal
- From Tom
- From brian
- From All of Us
- 1. Introduction
- Questions and Answers
- Is This the Right Book for You?
- Why Are There So Many Footnotes?
- What About the Exercises and Their Answers?
- What Do Those Numbers Mean at the Start of the Exercise?
- What If Im a Perl Course Instructor?
- What Does Perl Stand For?
- Why Did Larry Create Perl?
- Why Didnt Larry Just Use Some Other Language?
- Is Perl Easy or Hard?
- How Did Perl Get to Be So Popular?
- Whats Happening with Perl Now?
- Whats Perl Really Good For?
- What Is Perl Not Good For?
- How Can I Get Perl?
- What Is CPAN?
- How Can I Get Support for Perl?
- Are There Any Other Kinds of Support?
- What If I Find a Bug in Perl?
- How Do I Make a Perl Program?
- A Simple Program
- Whats Inside That Program?
- How Do I Compile My Perl Program?
- A Whirlwind Tour of Perl
- Exercises
- Questions and Answers
- 2. Scalar Data
- Numbers
- All Numbers Have the Same Format Internally
- Floating-Point Literals
- Integer Literals
- Nondecimal Integer Literals
- Numeric Operators
- Strings
- Single-Quoted String Literals
- Double-Quoted String Literals
- String Operators
- Automatic Conversion Between Numbers and Strings
- Perls Built-in Warnings
- Scalar Variables
- Choosing Good Variable Names
- Scalar Assignment
- Binary Assignment Operators
- Output with print
- Interpolation of Scalar Variables into Strings
- Creating Characters by Code Point
- Operator Precedence and Associativity
- Comparison Operators
- The if Control Structure
- Boolean Values
- Getting User Input
- The chomp Operator
- The while Control Structure
- The undef Value
- The defined Function
- Exercises
- Numbers
- 3. Lists and Arrays
- Accessing Elements of an Array
- Special Array Indices
- List Literals
- The qw Shortcut
- List Assignment
- The pop and push Operators
- The shift and unshift Operators
- The splice Operator
- Interpolating Arrays into Strings
- The foreach Control Structure
- Perls Favorite Default: $_
- The reverse Operator
- The sort Operator
- The each Operator
- Scalar and List Context
- Using List-Producing Expressions in Scalar Context
- Using Scalar-Producing Expressions in List Context
- Forcing Scalar Context
- <STDIN> in List Context
- Exercises
- 4. Subroutines
- Defining a Subroutine
- Invoking a Subroutine
- Return Values
- Arguments
- Private Variables in Subroutines
- Variable-Length Parameter Lists
- A Better &max Routine
- Empty Parameter Lists
- Notes on Lexical (my) Variables
- The use strict Pragma
- The return Operator
- Omitting the Ampersand
- Non-Scalar Return Values
- Persistent, Private Variables
- Exercises
- 5. Input and Output
- Input from Standard Input
- Input from the Diamond Operator
- The Invocation Arguments
- Output to Standard Output
- Formatted Output with printf
- Arrays and printf
- Filehandles
- Opening a Filehandle
- Binmoding Filehandles
- Bad Filehandles
- Closing a Filehandle
- Fatal Errors with die
- Warning Messages with warn
- Automatically die-ing
- Using Filehandles
- Changing the Default Output Filehandle
- Reopening a Standard Filehandle
- Output with say
- Filehandles in a Scalar
- Exercises
- 6. Hashes
- What Is a Hash?
- Why Use a Hash?
- Hash Element Access
- The Hash As a Whole
- Hash Assignment
- The Big Arrow
- Hash Functions
- The keys and values Functions
- The each Function
- Typical Use of a Hash
- The exists Function
- The delete Function
- Hash Element Interpolation
- The %ENV hash
- Exercises
- What Is a Hash?
- 7. In the World of Regular Expressions
- What Are Regular Expressions?
- Using Simple Patterns
- Unicode Properties
- About Metacharacters
- Simple Quantifiers
- Grouping in Patterns
- Alternatives
- Character Classes
- Character Class Shortcuts
- Negating the Shortcuts
- Exercises
- 8. Matching with Regular Expressions
- Matches with m//
- Match Modifiers
- Case-Insensitive Matching with /i
- Matching Any Character with /s
- Adding Whitespace with /x
- Combining Option Modifiers
- Choosing a Character Interpretation
- Other Options
- Anchors
- Word Anchors
- The Binding Operator =~
- Interpolating into Patterns
- The Match Variables
- The Persistence of Captures
- Noncapturing Parentheses
- Named Captures
- The Automatic Match Variables
- General Quantifiers
- Precedence
- Examples of Precedence
- And Theres More
- A Pattern Test Program
- Exercises
- 9. Processing Text with Regular Expressions
- Substitutions with s///
- Global Replacements with /g
- Different Delimiters
- Substitution Modifiers
- The Binding Operator
- Nondestructive Substitutions
- Case Shifting
- The split Operator
- The join Function
- m// in List Context
- More Powerful Regular Expressions
- Nongreedy Quantifiers
- Matching Multiple-Line Text
- Updating Many Files
- In-Place Editing from the Command Line
- Exercises
- Substitutions with s///
- 10. More Control Structures
- The unless Control Structure
- The else Clause with unless
- The until Control Structure
- Expression Modifiers
- The Naked Block Control Structure
- The elsif Clause
- Autoincrement and Autodecrement
- The Value of Autoincrement
- The for Control Structure
- The Secret Connection Between foreach and for
- Loop Controls
- The last Operator
- The next Operator
- The redo Operator
- Labeled Blocks
- The Conditional Operator ?:
- Logical Operators
- The Value of a Short Circuit Operator
- The defined-or Operator
- Control Structures Using Partial-Evaluation Operators
- Exercises
- The unless Control Structure
- 11. Perl Modules
- Finding Modules
- Installing Modules
- Using Your Own Directories
- Using Simple Modules
- The File::Basename Module
- Using Only Some Functions from a Module
- The File::Spec Module
- Path::Class
- CGI.pm
- Databases and DBI
- Dates and Times
- Exercises
- 12. File Tests
- File Test Operators
- Testing Several Attributes of the Same File
- Stacked File Test Operators
- The stat and lstat Functions
- The localtime Function
- Bitwise Operators
- Using Bitstrings
- Exercises
- File Test Operators
- 13. Directory Operations
- Moving Around the Directory Tree
- Globbing
- An Alternate Syntax for Globbing
- Directory Handles
- Recursive Directory Listing
- Manipulating Files and Directories
- Removing Files
- Renaming Files
- Links and Files
- Making and Removing Directories
- Modifying Permissions
- Changing Ownership
- Changing Timestamps
- Exercises
- 14. Strings and Sorting
- Finding a Substring with index
- Manipulating a Substring with substr
- Formatting Data with sprintf
- Using sprintf with Money Numbers
- Interpreting Non-Decimal Numerals
- Advanced Sorting
- Sorting a Hash by Value
- Sorting by Multiple Keys
- Exercises
- 15. Smart Matching and given-when
- The Smart Match Operator
- Smart Match Precedence
- The given Statement
- Dumb Matching
- Using when with Many Items
- Exercises
- 16. Process Management
- The system Function
- Avoiding the Shell
- The Environment Variables
- The exec Function
- Using Backquotes to Capture Output
- Using Backquotes in a List Context
- External Processes with IPC::System::Simple
- Processes as Filehandles
- Getting Down and Dirty with Fork
- Sending and Receiving Signals
- Exercises
- The system Function
- 17. Some Advanced Perl Techniques
- Slices
- Array Slice
- Hash Slice
- Trapping Errors
- Using eval
- More Advanced Error Handling
- autodie
- Picking Items from a List with grep
- Transforming Items from a List with map
- Fancier List Utilities
- Exercises
- Slices
- A. Exercise Answers
- Answers to Chapter 1 Exercises
- Answers to Chapter 2 Exercises
- Answers to Chapter 3 Exercises
- Answers to Chapter 4 Exercises
- Answers to Chapter 5 Exercises
- Answers to Chapter 6 Exercises
- Answers to Chapter 7 Exercises
- Answers to Chapter 8 Exercises
- Answers to Chapter 9 Exercises
- Answers to Chapter 10 Exercises
- Answer to Chapter 11 Exercises
- Answers to Chapter 12 Exercises
- Answers to Chapter 13 Exercises
- Answers to Chapter 14 Exercises
- Answers to Chapter 15 Exercises
- Answers to Chapter 16 Exercises
- Answer to Chapter 17 Exercises
- B. Beyond the Llama
- Further Documentation
- Regular Expressions
- Packages
- Extending Perls Functionality
- Libraries
- Writing Your Own Modules
- Databases
- Direct System Database Access
- Flat-File Database Access
- Other Operators and Functions
- Transliteration with tr///
- Here Documents
- Mathematics
- Advanced Math Functions
- Imaginary and Complex Numbers
- Large and High-Precision Numbers
- Lists and Arrays
- map and grep
- Bits and Pieces
- Formats
- Networking and IPC
- System V IPC
- Sockets
- Security
- Debugging
- Command-Line Options
- Built-in Variables
- Syntax Extensions
- References
- Complex Data Structures
- Object-Oriented Programming
- Anonymous Subroutines and Closures
- Tied Variables
- Operator Overloading
- Dynamic Loading
- Embedding
- Converting Other Languages to Perl
- Converting find Command Lines to Perl
- Command-Line Options in Your Programs
- Embedded Documentation
- More Ways to Open Filehandles
- Threads and Forking
- Graphical User Interfaces (GUIs)
- And More
- C. A Unicode Primer
- Unicode
- UTF-8 and Friends
- Getting Everyone to Agree
- Fancy Characters
- Fancier Characters
- Dealing with Unicode in Perl
- Using Unicode in Your Source
- Fancier Characters by Name
- Reading from STDIN or Writing to STDOUT or STDERR
- Reading from and Writing to Files
- Dealing with Command-Line Arguments
- Dealing with Databases
- Further Reading
- Index
- About the Authors
- Colophon
- Copyright