Zum Hauptinhalt springen
Dekorationsartikel gehören nicht zum Leistungsumfang.
Beginning Perl
Taschenbuch von Curtis Poe
Sprache: Englisch

41,50 €*

inkl. MwSt.

Versandkostenfrei per Post / DHL

Aktuell nicht verfügbar

Kategorien:
Beschreibung

Learn the Perl skills employers are looking for

As one of the most influential programming languages in the world, Perl is used extensively in web development, data processing, and system administration. Whether you're new to Perl or looking to strengthen your real-world skills, this resource covers what you need to handle scenarios. Drawing on his decade-plus of Perl experience, Curtis "Ovid" Poe begins with a brief review of the basics of Perl, then moves on to demonstrate how you actually use Perl in the workplace. Additionally, hands-on exercises, invaluable advice, and real-world examples all contribute to making this book essential reading.

Beginning Perl:

  • Explains how to work with data using Perl's built-in functions
  • Shows how to handle Unicode in Perl
  • Details the basics of control flow and handling references, files, and directories
  • Devotes a full chapter to Object-Oriented Perl as well as a chapter on Moose
  • Provides a comprehensive introduction to automated testing
  • Touches on Catalyst, DBIx::Class usage, and other popular modules
  • Technical edit by chromatic, a well-known developer, prolific writer, and author of several Perl titles

[...]

Programmer Forums Join our Programmer to Programmer forums to ask and answer programming questions about this book, join discussions on the hottest topics in the industry, and connect with fellow programmers from around the world.

Code Downloads Take advantage of free code samples from this book, as well as code samples from hundreds of other books, all ready to use.

Read More Find articles, ebooks, sample chapters and tables of contents for hundreds of books, and more reference resources on programming topics that matter to you.

Learn the Perl skills employers are looking for

As one of the most influential programming languages in the world, Perl is used extensively in web development, data processing, and system administration. Whether you're new to Perl or looking to strengthen your real-world skills, this resource covers what you need to handle scenarios. Drawing on his decade-plus of Perl experience, Curtis "Ovid" Poe begins with a brief review of the basics of Perl, then moves on to demonstrate how you actually use Perl in the workplace. Additionally, hands-on exercises, invaluable advice, and real-world examples all contribute to making this book essential reading.

Beginning Perl:

  • Explains how to work with data using Perl's built-in functions
  • Shows how to handle Unicode in Perl
  • Details the basics of control flow and handling references, files, and directories
  • Devotes a full chapter to Object-Oriented Perl as well as a chapter on Moose
  • Provides a comprehensive introduction to automated testing
  • Touches on Catalyst, DBIx::Class usage, and other popular modules
  • Technical edit by chromatic, a well-known developer, prolific writer, and author of several Perl titles

[...]

Programmer Forums Join our Programmer to Programmer forums to ask and answer programming questions about this book, join discussions on the hottest topics in the industry, and connect with fellow programmers from around the world.

Code Downloads Take advantage of free code samples from this book, as well as code samples from hundreds of other books, all ready to use.

Read More Find articles, ebooks, sample chapters and tables of contents for hundreds of books, and more reference resources on programming topics that matter to you.

Über den Autor

Curtis "Ovid" Poe has specialized in Perl since 2000. He is an author, a regular guest speaker at conferences across Europe and the United States, and he wrote the test harness that currently ships with the Perl language.

"This is not your everyday Beginning Perl book. Not only does Ovid provide splendid coverage of Perl's basics and best practices, he also covers modern Perl techniques and modules, where Perl's real power lies. [It] is like being given Batman's utility belt: you have everything you need to do truly amazing things. If Perl were a shark, this book would teach you how to outfit it with lasers." ?Paul Fenwick, Perl Training Australia

Wrox Beginning guides are crafted to make learning programming languages and technologies easier than you think, providing a structured, tutorial format that will guide you through all the techniques involved.

Inhaltsverzeichnis

Introduction xxiii

Chapter 1: What is Perl? 1

Perl Today 2

Getting Perl 3

Working with Non-Windows Platforms: perlbrew 4

Using Windows 6

The Perl Community 8

IRC 8

PerlMonks 9

Perl Mongers 9

StackOverflow 9

Using perldoc 11

Understanding the Structure of perldoc 11

Getting Started with perldoc 11

Using Tutorials and FAQs 12

Using the perldoc -f function 14

Using a Terminal Window 14

Using the Command Line 15

Creating a Work Directory 16

Creating Hello, World! 18

Writing Your First Program 18

Shebang Lines 21

Summary 22

Chapter 2: Understanding the CPAN 25

CPAN and METACPAN 26

Finding and Evaluating Modules 27

Downloading and Installing 29

CPAN Clients 33

Using the [...] Client 33

Using the Cpanm Client 35

PPM 36

CPAN::Mini 36

Summary 39

Chapter 3: Variables 41

What is Programming? 42

A Few Things to Note Before Getting Started 43

strict, warnings, and diagnostics 43

The my Function 43

Sigils 44

Identifiers 45

Scalars 46

Strings 47

Numbers 51

Arrays 53

Breaking Down the Code 54

Accessing Elements 55

Iterating over Arrays 58

Hashes 58

Accessing Elements 59

Iterating Over Hashes 60

Adding Data to Hashes 60

Slices 61

Array Slices 62

Hash Slices 62

Context 63

Scalar Context 63

List Context 64

Scope 67

my Variables 67

Package Variables 69

Strict, Warnings, and Diagnostics 72

strict 74

warnings 74

diagnostics 75

Working Without a Net 76

Perl's Built-in Variables 78

$_ 78

%ENV 79

[...] 79

Other Special Variables 80

Summary 81

Chapter 4: Working With Data 83

Using Scalars 84

Working with Strings 85

Using String Operators 94

Scalar::Util 97

Numeric Builtins 98

Bitwise Operators 103

Understanding Booleans 103

Assignment Operators 108

Precedence and Associativity 109

Array and List Functions 111

Built-in Array Functions 111

List::Util 116

Built-in Hash Functions 116

delete() 116

exists() 117

keys() 117

values() 117

each() 117

Scoping Keywords 119

my() 119

local() 119

our() 120

state() 120

Summary 121

Chapter 5: Control Flow 125

Using the if Statement 126

Understanding Basic Conditionals 126

else/elsif/unless 128

The Ternary Operator ?: 131

for/foreach loops 132

Arrays 132

Lists 135

C-Style 136

Using while/until Loops 142

Lists 143

last/next/redo/continue 144

Labels 146

Statement Modifiers 147

Types of Statement Modifiers 147

do while/do until 149

given/when 151

Basic Syntax 151

The Switch Module 153

Summary 154

Chapter 6: References 157

References 101 158

Array References 158

Hash References 159

Anonymous References 160

Other References 163

Working with References 166

Debugging 166

Copying 169

Slices 172

Summary 173

Chapter 7: Subroutines 175

Subroutine Syntax 176

Argument Handling 177

Multiple Arguments 178

Named Arguments 179

Aliasing 181

State Variables (Pre- and Post-5.10) 181

Passing a List, Hash, or Hashref? 184

Returning Data 186

Returning True/False 186

Returning Single and Multiple Values 188

wantarray 189

FAIL! 190

"Wake Up! Time to Die!" 191

carp and croak 192

eval 192

evalGotchas 194

Try::Tiny 195

Subroutine References 196

Existing Subroutines 196

Anonymous Subroutines 197

Closures 197

Prototypes 200

Argument Coercion 200

More Prototype Tricks 202

Mimicking Builtins 204

Forward Declarations 206

Prototype Summary 207

Recursion 209

Basic Recursion 209

Divide and Conquer 210

Memoization 211

Things to Watch For 215

Argument Aliasing 215

Scope Issues 216

Doing Too Much 216

Too Many Arguments 217

Summary 217

Chapter 8: Regular Expressions 219

Basic Matching 220

Quantifiers 221

Escape Sequences 223

Extracting Data 226

Modifiers and Anchors 228

Character Classes 231

Grouping 232

Advanced Matching 235

Substitutions 235

Lookahead/Lookbehind Anchors 236

Named Subexpressions (5.10) 238

Common Regular Expression Issues 241

Regexp::Common 241

E-mail Addresses 242

HTML 242

Composing Regular Expressions 243

Summary 245

Chapter 9: Files and Directories 249

Basic File Handling 250

Opening and Reading a File 250

File Test Operators 258

The Diamond Operator 260

Temporary Files 260

DATA as a File 261

binmode 262

Directories 265

Reading Directories 265

Globbing 265

Unicode 266

What is Unicode? 267

Two Simple Rules 267

Lots of Complicated Rules 271

Useful Modules 276

File::Find 276

File::Path 278

File::Find::Rule 279

Summary 284

Chapter 10: Sort, Map, and Grep 287

Basic Sorting 288

Sorting Alphabetically 288

Sorting Numerically 289

Reverse Sorting 290

Complex Sort Conditions 290

Writing a sort Subroutine 292

Sorting and Unicode Fun! 293

map and grep 297

Using grep 298

Using map 303

Aliasing Issues 305

Trying to Do Too Much 306

Trying to Be Clever 307

Putting It All Together 308

Schwartzian Transform (aka decorate, sort, undecorate) 308

Guttman-Rosler Transform 310

Summary 311

Chapter 11: Packages and Modules 315

Namespaces and Packages 316

use Versus require 321

Package Variables 323

Version Numbers 326

Subroutines in Other Packages 327

Exporting 327

Naming Conventions 330

BEGIN, UNITCHECK, CHECK, INIT, and END 335

BEGIN blocks 336

END Blocks 337

INIT, CHECK, and UNITCHECK Blocks 337

Plain Old Documentation (POD) 338

Documentation Structure 340

Headings 340

Paragraphs 341

Lists 341

Verbatim 342

Miscellaneous 342

Creating and Installing Modules 344

Creating a Simple Module 344

Makefi [...] or Module::Build? 349

Summary 349

Chapter 12: Object Oriented Perl 353

What are Objects? The Ævar the Personal Shopper 354

Three Rules of Perl OO 355

Class is a Package 355

An Object is a Reference That Knows Its Class 356

A Method is a Subroutine 358

Objects - Another View 371

Using TV::Episode 371

Subclassing 374

Using TV::Episode::Broadcast 375

Class Versus Instance Data 379

A Brief Recap 381

Overloading Objects 381

Using UNIVERSAL 385

Understanding Private Methods 387

Gotchas 393

Unnecessary Methods 393

"Reaching Inside" 394

Multiple Inheritance 394

Summary 397

Chapter 13: Moose 399

Understanding Basic Moose Syntax 400

Using Attributes 402

Using Constructors 405

Understanding Inheritance 408

Taking Care of Your Moose 409

Advanced Moose Syntax 413

Using Type Constraints 414

Using Method Modifiers 417

Understanding and Using Roles 420

Exploring MooseX 425

Rewriting Television::Episode 428

Moose Best Practices 433

Use namespace::autoclean and Make Your Class Immutable 434

Never Override new() 434

Always Call Your Parent BUILDARGS Method 434

Provide Defaults if an Attribute is Not Required 434

Default to Read-Only 434

Put Your Custom Types in One Module and

Give Them a Namespace 435

Don't Use Multiple Inheritance 435

Always Consume All Your Roles at Once 435

Summary 436

Chapter 14: Testing 439

Basic Tests 440

Using Test::More 440

Writing Your Tests 442

Understanding the prove Utility 443

Understanding Test::More Test Functions 444

Using ok 445

Using is 445

Using like 448

Using is_deeply 449

Using SKIP 450

Using TODO 450

Using eval {} 451

Using use_ok and require_ok 452

Working with Miscellaneous Test Functions 453

Using Other Testing Modules 457

Using Test::Diff erences 457

Using Test::Exception 459

Using Test::Warn 460

Using Test::Most 460

Understanding xUnit Style Using Testing 461

Using Test::Class 461

A Basic Test Class 463

Extending a Test Class 467

Using Test Control Methods 471

Calling Parent Test Control Methods 473

Summary 477

Chapter 15: The Interwebs 481

A Brief Introduction to HTTP 482

Plack 484

Hello, World! 484

Handling Parameters 490

Templates 492

Handling POST Requests 496

Sessions 500

Web Clients 511

Extracting Links from Web Pages 512

Extracting Comments from Web Pages 514

Filling Out Forms Programmatically 515

Summary 520

Chapter 16: Databases 523

Using the DBI 524

Connecting to a Database 524

Using SQLite 527

Using DBD::SQLite 527

...
Details
Erscheinungsjahr: 2012
Fachbereich: Programmiersprachen
Genre: Informatik
Rubrik: Naturwissenschaften & Technik
Medium: Taschenbuch
Inhalt: 752 S.
ISBN-13: 9781118013847
ISBN-10: 1118013840
Sprache: Englisch
Herstellernummer: 1W118013840
Einband: Kartoniert / Broschiert
Autor: Poe, Curtis
Hersteller: Wiley
John Wiley & Sons
Maße: 235 x 191 x 40 mm
Von/Mit: Curtis Poe
Erscheinungsdatum: 19.09.2012
Gewicht: 1,367 kg
Artikel-ID: 107066603
Über den Autor

Curtis "Ovid" Poe has specialized in Perl since 2000. He is an author, a regular guest speaker at conferences across Europe and the United States, and he wrote the test harness that currently ships with the Perl language.

"This is not your everyday Beginning Perl book. Not only does Ovid provide splendid coverage of Perl's basics and best practices, he also covers modern Perl techniques and modules, where Perl's real power lies. [It] is like being given Batman's utility belt: you have everything you need to do truly amazing things. If Perl were a shark, this book would teach you how to outfit it with lasers." ?Paul Fenwick, Perl Training Australia

Wrox Beginning guides are crafted to make learning programming languages and technologies easier than you think, providing a structured, tutorial format that will guide you through all the techniques involved.

Inhaltsverzeichnis

Introduction xxiii

Chapter 1: What is Perl? 1

Perl Today 2

Getting Perl 3

Working with Non-Windows Platforms: perlbrew 4

Using Windows 6

The Perl Community 8

IRC 8

PerlMonks 9

Perl Mongers 9

StackOverflow 9

Using perldoc 11

Understanding the Structure of perldoc 11

Getting Started with perldoc 11

Using Tutorials and FAQs 12

Using the perldoc -f function 14

Using a Terminal Window 14

Using the Command Line 15

Creating a Work Directory 16

Creating Hello, World! 18

Writing Your First Program 18

Shebang Lines 21

Summary 22

Chapter 2: Understanding the CPAN 25

CPAN and METACPAN 26

Finding and Evaluating Modules 27

Downloading and Installing 29

CPAN Clients 33

Using the [...] Client 33

Using the Cpanm Client 35

PPM 36

CPAN::Mini 36

Summary 39

Chapter 3: Variables 41

What is Programming? 42

A Few Things to Note Before Getting Started 43

strict, warnings, and diagnostics 43

The my Function 43

Sigils 44

Identifiers 45

Scalars 46

Strings 47

Numbers 51

Arrays 53

Breaking Down the Code 54

Accessing Elements 55

Iterating over Arrays 58

Hashes 58

Accessing Elements 59

Iterating Over Hashes 60

Adding Data to Hashes 60

Slices 61

Array Slices 62

Hash Slices 62

Context 63

Scalar Context 63

List Context 64

Scope 67

my Variables 67

Package Variables 69

Strict, Warnings, and Diagnostics 72

strict 74

warnings 74

diagnostics 75

Working Without a Net 76

Perl's Built-in Variables 78

$_ 78

%ENV 79

[...] 79

Other Special Variables 80

Summary 81

Chapter 4: Working With Data 83

Using Scalars 84

Working with Strings 85

Using String Operators 94

Scalar::Util 97

Numeric Builtins 98

Bitwise Operators 103

Understanding Booleans 103

Assignment Operators 108

Precedence and Associativity 109

Array and List Functions 111

Built-in Array Functions 111

List::Util 116

Built-in Hash Functions 116

delete() 116

exists() 117

keys() 117

values() 117

each() 117

Scoping Keywords 119

my() 119

local() 119

our() 120

state() 120

Summary 121

Chapter 5: Control Flow 125

Using the if Statement 126

Understanding Basic Conditionals 126

else/elsif/unless 128

The Ternary Operator ?: 131

for/foreach loops 132

Arrays 132

Lists 135

C-Style 136

Using while/until Loops 142

Lists 143

last/next/redo/continue 144

Labels 146

Statement Modifiers 147

Types of Statement Modifiers 147

do while/do until 149

given/when 151

Basic Syntax 151

The Switch Module 153

Summary 154

Chapter 6: References 157

References 101 158

Array References 158

Hash References 159

Anonymous References 160

Other References 163

Working with References 166

Debugging 166

Copying 169

Slices 172

Summary 173

Chapter 7: Subroutines 175

Subroutine Syntax 176

Argument Handling 177

Multiple Arguments 178

Named Arguments 179

Aliasing 181

State Variables (Pre- and Post-5.10) 181

Passing a List, Hash, or Hashref? 184

Returning Data 186

Returning True/False 186

Returning Single and Multiple Values 188

wantarray 189

FAIL! 190

"Wake Up! Time to Die!" 191

carp and croak 192

eval 192

evalGotchas 194

Try::Tiny 195

Subroutine References 196

Existing Subroutines 196

Anonymous Subroutines 197

Closures 197

Prototypes 200

Argument Coercion 200

More Prototype Tricks 202

Mimicking Builtins 204

Forward Declarations 206

Prototype Summary 207

Recursion 209

Basic Recursion 209

Divide and Conquer 210

Memoization 211

Things to Watch For 215

Argument Aliasing 215

Scope Issues 216

Doing Too Much 216

Too Many Arguments 217

Summary 217

Chapter 8: Regular Expressions 219

Basic Matching 220

Quantifiers 221

Escape Sequences 223

Extracting Data 226

Modifiers and Anchors 228

Character Classes 231

Grouping 232

Advanced Matching 235

Substitutions 235

Lookahead/Lookbehind Anchors 236

Named Subexpressions (5.10) 238

Common Regular Expression Issues 241

Regexp::Common 241

E-mail Addresses 242

HTML 242

Composing Regular Expressions 243

Summary 245

Chapter 9: Files and Directories 249

Basic File Handling 250

Opening and Reading a File 250

File Test Operators 258

The Diamond Operator 260

Temporary Files 260

DATA as a File 261

binmode 262

Directories 265

Reading Directories 265

Globbing 265

Unicode 266

What is Unicode? 267

Two Simple Rules 267

Lots of Complicated Rules 271

Useful Modules 276

File::Find 276

File::Path 278

File::Find::Rule 279

Summary 284

Chapter 10: Sort, Map, and Grep 287

Basic Sorting 288

Sorting Alphabetically 288

Sorting Numerically 289

Reverse Sorting 290

Complex Sort Conditions 290

Writing a sort Subroutine 292

Sorting and Unicode Fun! 293

map and grep 297

Using grep 298

Using map 303

Aliasing Issues 305

Trying to Do Too Much 306

Trying to Be Clever 307

Putting It All Together 308

Schwartzian Transform (aka decorate, sort, undecorate) 308

Guttman-Rosler Transform 310

Summary 311

Chapter 11: Packages and Modules 315

Namespaces and Packages 316

use Versus require 321

Package Variables 323

Version Numbers 326

Subroutines in Other Packages 327

Exporting 327

Naming Conventions 330

BEGIN, UNITCHECK, CHECK, INIT, and END 335

BEGIN blocks 336

END Blocks 337

INIT, CHECK, and UNITCHECK Blocks 337

Plain Old Documentation (POD) 338

Documentation Structure 340

Headings 340

Paragraphs 341

Lists 341

Verbatim 342

Miscellaneous 342

Creating and Installing Modules 344

Creating a Simple Module 344

Makefi [...] or Module::Build? 349

Summary 349

Chapter 12: Object Oriented Perl 353

What are Objects? The Ævar the Personal Shopper 354

Three Rules of Perl OO 355

Class is a Package 355

An Object is a Reference That Knows Its Class 356

A Method is a Subroutine 358

Objects - Another View 371

Using TV::Episode 371

Subclassing 374

Using TV::Episode::Broadcast 375

Class Versus Instance Data 379

A Brief Recap 381

Overloading Objects 381

Using UNIVERSAL 385

Understanding Private Methods 387

Gotchas 393

Unnecessary Methods 393

"Reaching Inside" 394

Multiple Inheritance 394

Summary 397

Chapter 13: Moose 399

Understanding Basic Moose Syntax 400

Using Attributes 402

Using Constructors 405

Understanding Inheritance 408

Taking Care of Your Moose 409

Advanced Moose Syntax 413

Using Type Constraints 414

Using Method Modifiers 417

Understanding and Using Roles 420

Exploring MooseX 425

Rewriting Television::Episode 428

Moose Best Practices 433

Use namespace::autoclean and Make Your Class Immutable 434

Never Override new() 434

Always Call Your Parent BUILDARGS Method 434

Provide Defaults if an Attribute is Not Required 434

Default to Read-Only 434

Put Your Custom Types in One Module and

Give Them a Namespace 435

Don't Use Multiple Inheritance 435

Always Consume All Your Roles at Once 435

Summary 436

Chapter 14: Testing 439

Basic Tests 440

Using Test::More 440

Writing Your Tests 442

Understanding the prove Utility 443

Understanding Test::More Test Functions 444

Using ok 445

Using is 445

Using like 448

Using is_deeply 449

Using SKIP 450

Using TODO 450

Using eval {} 451

Using use_ok and require_ok 452

Working with Miscellaneous Test Functions 453

Using Other Testing Modules 457

Using Test::Diff erences 457

Using Test::Exception 459

Using Test::Warn 460

Using Test::Most 460

Understanding xUnit Style Using Testing 461

Using Test::Class 461

A Basic Test Class 463

Extending a Test Class 467

Using Test Control Methods 471

Calling Parent Test Control Methods 473

Summary 477

Chapter 15: The Interwebs 481

A Brief Introduction to HTTP 482

Plack 484

Hello, World! 484

Handling Parameters 490

Templates 492

Handling POST Requests 496

Sessions 500

Web Clients 511

Extracting Links from Web Pages 512

Extracting Comments from Web Pages 514

Filling Out Forms Programmatically 515

Summary 520

Chapter 16: Databases 523

Using the DBI 524

Connecting to a Database 524

Using SQLite 527

Using DBD::SQLite 527

...
Details
Erscheinungsjahr: 2012
Fachbereich: Programmiersprachen
Genre: Informatik
Rubrik: Naturwissenschaften & Technik
Medium: Taschenbuch
Inhalt: 752 S.
ISBN-13: 9781118013847
ISBN-10: 1118013840
Sprache: Englisch
Herstellernummer: 1W118013840
Einband: Kartoniert / Broschiert
Autor: Poe, Curtis
Hersteller: Wiley
John Wiley & Sons
Maße: 235 x 191 x 40 mm
Von/Mit: Curtis Poe
Erscheinungsdatum: 19.09.2012
Gewicht: 1,367 kg
Artikel-ID: 107066603
Warnhinweis

Ähnliche Produkte

Ähnliche Produkte