Beginning Perl - James Lee

Beginning Perl (eBook)

(Autor)

eBook Download: PDF
2010 | 3rd ed.
464 Seiten
Apress (Verlag)
978-1-4302-2794-6 (ISBN)
Systemvoraussetzungen
46,99 inkl. MwSt
  • Download sofort lieferbar
  • Zahlungsarten anzeigen

This is a book for those of us who believed that we didn't need to learn Perl, and now we know it is more ubiquitous than ever. Perl is extremely flexible and powerful, and it isn't afraid of Web 2.0 or the cloud. Originally touted as the duct tape of the Internet, Perl has since evolved into a multipurpose, multiplatform language present absolutely everywhere: heavy-duty web applications, the cloud, systems administration, natural language processing, and financial engineering. Beginning Perl, Third Edition provides valuable insight into Perl's role regarding all of these tasks and more.

Commencing with a comprehensive overview of language basics, you'll learn all about important concepts such as Perl's data types and control flow constructs. This material sets the stage for a discussion of more complex topics, such as writing custom functions, using regular expressions, and file input and output. Next, the book moves on to the advanced topics of object-oriented programming, modules, web programming, and database administration with Perl's powerful database interface module, DBI. The examples and code provided offer you all of the information you need to start writing your own powerful scripts to solve the problems listed above, and many more.

Whether you are a complete novice or an experienced programmer, Beginning Perl, Third Edition offers an ideal guide to learning Perl.



James Lee is a hacker and open-source advocate based in Illinois. He holds a master's degree from Northwestern University, and he can often be seen rooting for the Wildcats during football season. As founder of Onsight, Lee has worked as a programmer, trainer, manager, writer, and open-source advocate. Lee coauthored Hacking Linux Exposed, Second Edition, as well as Open Source Web Development with LAMP. He enjoys hacking Perl and has written many articles on Perl for Linux Journal. Lee also enjoys developing software for the Web, reading, traveling and, most of all, playing with his kids, who are too young to know why dad's favorite animals are penguins and camels.
Perl was originally written by Larry Wall while he was working at NASA's Jet Propulsion Labs. Larry is an Internet legend, known not just for Perl, but as the author of the UNIX utilities rn, one of the original Usenet newsreaders, and patch, a tremendously useful tool that takes a list of differences between two files and allows you to turn one into the other. The term patch used for this activity is now widespread. Perl started life as a "e;glue"e; language for Larry and his officemates, allowing one to "e;stick"e; different tools together by converting between their various data formats. It pulled together the best features of several languages: the powerful regular expressions from sed (the Unix stream editor), the patte- scanning language awk, and a few other languages and utilities. The syntax was further made up out of C, Pascal, Basic, Unix shell languages, English, and maybe a few other elements along the way. While Perl started its life as glue, it is now more often likened to another handy multiuse tool: duct tape. A common statement heard in cyberspace is that Perl is the duct tape that holds the Internet together.

James Lee is a hacker and open-source advocate based in Illinois. He holds a master's degree from Northwestern University, and he can often be seen rooting for the Wildcats during football season. As founder of Onsight, Lee has worked as a programmer, trainer, manager, writer, and open-source advocate. Lee coauthored Hacking Linux Exposed, Second Edition, as well as Open Source Web Development with LAMP. He enjoys hacking Perl and has written many articles on Perl for Linux Journal. Lee also enjoys developing software for the Web, reading, traveling and, most of all, playing with his kids, who are too young to know why dad's favorite animals are penguins and camels.

Contents at a Glance 5
Contents 6
About the Author 17
About the Technical Reviewers 18
Acknowledgments 19
Introduction 20
First Steps in Perl 31
Programming Languages 31
Our First Perl Program 32
Character Sets 38
Escape Sequences 38
Number Systems 39
The Perl Debugger 41
Summary 41
Exercises 42
Scalars 43
Types of Data 43
Operators 52
Variables 68
Variable Interpolation 76
Two Miscellaneous Functions 80
Summary 82
Exercises 82
Control Flow Constructs 83
The if Statement 84
Looping Constructs 96
The while Loop 96
Loop Control Constructs 104
Summary 109
Exercises 109
Lists and Arrays 110
Lists 110
Arrays 120
Summary 143
Exercises 143
Hashes 144
Creating a Hash 144
Hash in List Context 148
Hash in Scalar Context 149
Hash Functions 150
Hash Examples 154
Summary 158
Exercises 158
Subroutines/Functions 160
Understanding Subroutines 161
Passing Arguments into Functions 166
Return Values 168
Understanding Scope 171
Some Important Notes on Passing Arguments 176
Summary 181
Exercises 181
Regular Expressions 182
What Are They? 182
Working with Regexes 199
Summary 205
Exercises 206
Files and Data 207
Filehandles 207
Reading with the Diamond 213
Writing to Files 220
Opening Pipes 224
File Tests 228
Summary 233
Exercises 233
String Processing 235
Character Position 235
String Functions 236
Summary 241
Exercises 241
Interfacing to the Operating System 243
The %ENV Hash 243
Working with Files and Directories 245
Executing External Programs 253
There’s More 256
Summary 256
Exercises 257
References 258
What Is a Reference? 258
The Life Cycle of a Reference 259
Using References for Complex Data Structures 271
Summary 282
Exercises 282
Modules 283
Why Do We Need Them? 283
Creating a Module 284
Including Other Files with use 286
Exporters 291
The Perl Standard Modules 293
CPAN 304
Summary 312
Object-Oriented Perl 313
OO Buzzwords 313
An Example 318
Rolling Your Own Classes 321
Do You Need OO? 339
Summary 341
Exercises 341
Introduction to CGI 342
We Need a Web Server 343
Writing CGI Programs 343
Introducing CGI.pm 350
CGI.pm Methods 357
Processing Form Data 358
Let’s Play Chess! 363
What We Did Not Talk About 372
Summary 373
Exercises 373
Perl and DBI 374
Introduction to Relational Databases 374
We Need an SQL Server—MySQL 378
Introduction to DBI 393
Perl, DBI, and CGI 403
What We Didn’t Talk About 410
Summary 411
Exercises 411
Exercise Solutions 412
Chapter 1 412
Chapter 2 412
Chapter 3 414
Chapter 4 415
Chapter 5 416
Chapter 6 418
Chapter 7 420
Chapter 8 421
Chapter 9 423
Chapter 10 424
Chapter 11 425
Chapter 13 429
Chapter 14 430
Chapter 15 431
Index 434

Erscheint lt. Verlag 14.6.2010
Zusatzinfo 464 p.
Verlagsort Berkeley
Sprache englisch
Themenwelt Mathematik / Informatik Informatik Programmiersprachen / -werkzeuge
Informatik Software Entwicklung Objektorientierung
Mathematik / Informatik Informatik Theorie / Studium
Mathematik / Informatik Informatik Web / Internet
Schlagworte Function • NATURAL • object • object-oriented programming • Perl • Processing • programming • Regular Expressions • Scala
ISBN-10 1-4302-2794-X / 143022794X
ISBN-13 978-1-4302-2794-6 / 9781430227946
Haben Sie eine Frage zum Produkt?
PDFPDF (Wasserzeichen)
Größe: 4,4 MB

DRM: Digitales Wasserzeichen
Dieses eBook enthält ein digitales Wasser­zeichen und ist damit für Sie persona­lisiert. Bei einer missbräuch­lichen Weiter­gabe des eBooks an Dritte ist eine Rück­ver­folgung an die Quelle möglich.

Dateiformat: PDF (Portable Document Format)
Mit einem festen Seiten­layout eignet sich die PDF besonders für Fach­bücher mit Spalten, Tabellen und Abbild­ungen. Eine PDF kann auf fast allen Geräten ange­zeigt werden, ist aber für kleine Displays (Smart­phone, eReader) nur einge­schränkt geeignet.

Systemvoraussetzungen:
PC/Mac: Mit einem PC oder Mac können Sie dieses eBook lesen. Sie benötigen dafür einen PDF-Viewer - z.B. den Adobe Reader oder Adobe Digital Editions.
eReader: Dieses eBook kann mit (fast) allen eBook-Readern gelesen werden. Mit dem amazon-Kindle ist es aber nicht kompatibel.
Smartphone/Tablet: Egal ob Apple oder Android, dieses eBook können Sie lesen. Sie benötigen dafür einen PDF-Viewer - z.B. die kostenlose Adobe Digital Editions-App.

Buying eBooks from abroad
For tax law reasons we can sell eBooks just within Germany and Switzerland. Regrettably we cannot fulfill eBook-orders from other countries.

Mehr entdecken
aus dem Bereich
Entwicklung von GUIs für verschiedene Betriebssysteme

von Achim Lingott

eBook Download (2023)
Carl Hanser Verlag GmbH & Co. KG
39,99
Grundlagen, Objektorientierung und fortgeschrittene Konzepte

von Christian Kohls; Alexander Dobrynin

eBook Download (2023)
Carl Hanser Verlag GmbH & Co. KG
39,99