programming_perl_4e.pdf

(15492 KB) Pobierz
FOURTH EDITION
Programming Perl
Tom Christiansen, brian d foy & Larry Wall
with Jon Orwant
Beijing
Cambridge
Farnham
Köln
Sebastopol
Tokyo
Programming Perl, Fourth Edition
by Tom Christiansen, brian d foy & Larry Wall, with Jon Orwant
Copyright © 2012 Tom Christiansen, brian d foy, Larry Wall, and Jon Orwant. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.
O’Reilly books may be purchased for educational, business, or sales promotional use. Online
editions are also available for most titles (http://safaribooksonline.com). For more information,
contact our corporate/institutional sales department: (800) 998-9938 or
corporate@oreilly.com.
Editor:
Andy Oram
Production Editor:
Holly Bauer
Proofreader:
Marlowe Shaeffer
Indexer:
Lucie Haskins
January 1991:
September 1996:
July 2000:
February 2012:
First Edition.
Second Edition.
Third Edition.
Fourth Edition.
Cover Designer:
Karen Montgomery
Interior Designer:
David Futato
Illustrator:
Robert Romano
Revision History for the Fourth Edition:
2012-06-15 Second release
2013-12-13 Third release
2015-07-10 Fourth release
See
http://oreilly.com/catalog/errata.csp?isbn=9780596004927
for release details.
Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of
O’Reilly Media, Inc.
Programming Perl,
the image of a dromedary camel, and related trade dress are
trademarks of O’Reilly Media, Inc.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as
trademarks. Where those designations appear in this book, and O’Reilly Media, Inc., was aware of a
trademark claim, the designations have been printed in caps or initial caps.
While every precaution has been taken in the preparation of this book, the publisher and authors
assume no responsibility for errors or omissions, or for damages resulting from the use of the
information contained herein.
ISBN: 978-0-596-00492-7
[M]
1435867745
Table of Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii
Part I. Overview
1. An Overview of Perl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Getting Started
Natural and Artificial Languages
Variable Syntax
Verbs
An Average Example
How to Do It
Filehandles
Operators
Some Binary Arithmetic Operators
String Operators
Assignment Operators
Unary Arithmetic Operators
Logical Operators
Some Numeric and String Comparison Operators
Some File Test Operators
Control Structures
What Is Truth?
The given and when Statements
Looping Constructs
Regular Expressions
Quantifiers
Minimal Matching
Nailing Things Down
Backreferences
3
4
5
17
18
20
21
24
25
25
26
28
29
30
31
31
32
34
35
39
43
44
44
45
iii
Zgłoś jeśli naruszono regulamin