Praise for Beginning Perl, Second Edition

Total Page:16

File Type:pdf, Size:1020Kb

Praise for Beginning Perl, Second Edition Praise for Beginning Perl, Second Edition: "This book is a well-conceived introduction to Perl in tutorial form, covering the basics ofPerl and also covering the basics ofsome more­ advanced areas ofPerl." -George Woolley, Oakland Perl Mongers (http:/ I oakland.pm.org) "Beginning Perl, Second Edition, is a great choice to move from no knowledge or little knowledge of Perl to becoming an intermediate Perl user. It is highly recommended to anyone wanting to acquire a well-rounded foundation in Perl." -Harold McFarland, Midwest Book Review (www.midwestbookreview.com) "If I were to write an introductory Perl text, I'd want it to look like the first 10 chapters of this book. If you are a complete novice, though, I think this book is as gentle an introduction to Perl as you'll find anywhere." -Ed Schaefer, Unix Review (www.unixreview.com) "The Perl [this book] teaches is strong industry-standard Perl that is ... considered best practice." -Jack Herrington, Editor, Code Generation Network (www.codegeneration.net) "This book is a well-conceived introduction to Perl in tutorial form ... A Very Good Book. :) :) :) :) of5." -Mark Spritzler, Javaranch Bartender (www.javaranch.com) "To summarize, ifyou've wanted to learn Perl but haven't yet taken the plunge, you could do a lot worse than to start with this book. It's a casual tour of the basics with a few teasers for further study opportunities." -James Edward Gray II, Slashdot contributor (www.slashdot.org) Beginning Perl, Second Edition JAMES LEE with SIMON COZENS and PETER WAINWRIGHT APress Media, LLC Beginning Peri, Second Edition Copyright C 2004 by James Lee, Simon Cozens, Peter Wainwright Originally published by Apress in 2004 Ali rights reserved. No part of this work rnay be reproduced or transrnitted in any form or by any rneans, electronic or rnechanical, including photocopying, recording, or by any information storage or retrieval systern, without the prior written perrnission of the copyright owner and the publisher. ISBN 978-1-59059-391-2 ISBN 978-1-4302-0665-1 (eBook) DOI 10.1007/978-1-4302-0665-1 Tradernarked narnes rnay appear in this book. Rather than use a tradernark syrnbol with every occurrence of a tradernarked narne, we use the narnes only in an editorial fashion and to the benefit of the tradernark owner, with no intention of infringernent of the tradernark. Lead Editor: Chris Mills Technical Reviewer: Sarn Tregar Editorial Board: Steve Anglin, Dan Applernan, Ewan Buckingharn, Gary Cornell, Tony Davis, Iason Gilrnore, Jonathon Hassell, Chris Mills, Dorninic Shakeshaft, Jirn Surnser Project Manager: Kylie Johnston Copy Edit Manager: Nicole LeClerc Copy Editor: Arni Knox Production Manager: Kari Brooks Production Editor: Katie Stence Cornpositor and Artist: Kinetic Publishing Services, LLC Proofreader: Elizabeth Berry Indexer: John Collin Cover Designer: Kurt Krarnes Manufacturing Manager: Torn Debolski In the United States: phone 1-800-SPRINGER, e-mail orders@springer -ny. corn, or visit http: 1/IWIW. springer -ny. corn. Outside the United States: fax +49 6221 345229, e-mail orders@springer. de, or visit http: 1lwww. springer. de. For information on translations, please contactApress directly at 2560 Ninth Street, Suite 219, Berkeley, CA 94 71 O. Phone 510-549-5930, fax 510-549-5939, e-mall info@apress. corn, or visit http: 1lwww. apress. corn. The information in this book is distributed onan "as is" hasis, without warranty. Although every precau­ tion has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to any person or entity with respect to any loss or darnage caused or alleged to be caused directly or indirectly by the inforrnation contained in this work. The source code for this book is available to readers at http: 1/www. apress. corn in the Source Code section. To Kelli, Ryan, Christian, and Madeline Contents at a Glance About the Author .................................................................. xv Acknowledgments ............................................................... xvii Introduction ...................................................................... xix CHAPTER 1 First Steps in Perl .............................................. 1 CHAPTER 2 Scalars ........................................................ 13 CHAPTER 3 Control Flow Constructs ....................................... 51 CHAPTER 4 Lists and Arrays ............................................... 77 CHAPTER 5 Hashes ....................................................... 111 CHAPTER 6 Subroutines/Functions ........................................ 121 CHAPTER 7 Regular Expressions .......................................... 149 CHAPTER 8 Files and Data ................................................ 177 CHAPTER 9 String Processing ............................................. 205 CHAPTER 10 Interfacing to the Operating System ........................... 213 CHAPTER 11 References .................................................... 229 CHAPTER 12 Object-Oriented Perl .......................................... 253 CHAPTER 13 Modules ...................................................... 287 CHAPTER 14 Introduction to CGI. ........................................... 315 CHAPTER 15 Perl and OBI .................................................. 347 APPENDIX Exercise Solutions ............................................ 385 INDEX ......................................................................... 407 v Contents About the Author .................................................................. xv Acknowledgments ............................................................... xvii Introduction ...................................................................... xix HAPTER 1 First Steps in Perl ............................................ 1 Programming Languages .......................................... 1 Our First Perl Program ............................................ 2 Program Structure ........................................... 5 Escape Sequences ........................................... 8 Whitespace ................................................. 8 Number Systems ................................................. 8 The Perl Debugger ............................................... 1o Summary ...................................................... 10 Exercises ....................................................... 11 HAPTER 2 Scalars: ....................................................... 13 Types of Data ................................................... 13 Numbers .................................................. 14 Strings .................................................... 17 Here-Documents ........................................... 20 Converting Between Numbers and Strings ..................... 20 Operators ...................................................... 21 Numeric Operators ......................................... 22 String Operators ............................................ 31 Operators to Be Seen Later .................................. 35 Operator Precedence ........................................ 36 Variables ....................................................... 37 Scoping ................................................... 41 Variable Names ............................................ 44 Variable Interpolation ............................................ 44 Currency Converter ......................................... 46 vii viii Two Miscellaneous Functions ..................................... 48 The exitO Function .......................................... 48 The dieO Function .......................................... 49 Summary ...................................................... 50 Exercises ....................................................... 50 3 Control Flow Constructs;, .................................... 51 The if Statement ................................................ 52 Operators Revisited ......................................... 53 Multiple Choice: if ... else ................................... 58 The unless Statement ....................................... 61 Expression Modifiers ........................................ 62 Using Short-Circuited Evaluation .............................. 63 Looping Constructs .............................................. 63 The while Loop .................................................. 63 while (<STDIN>) ........................................... 65 Infinite Loops .............................................. 66 Looping Until ............................................... 67 The for Loop ............................................... 68 The foreach Loop ........................................... 68 do .. while and do .. until .................................... 69 Loop Control Constructs .......................................... 71 Breaking Out. .............................................. 71 Going On to the Next ........................................ 72 Reexecuting the Loop ....................................... 73 Loop Labels ................................................ 74 goto ...................................................... 76 Summary ...................................................... 76 Exercises ....................................................... 76 4 Lists and Arrays ............................................. 77 Lists ........................................................... 77 Simple Lists ............................................... 77 Less Simple Lists ..........................................
Recommended publications
  • Advancing Perl Supporting Community
    Advancing Perl Supporting Community 2012 Year End Report Board of Directors Nathan Torkington Chairman Karen Pauley President Jim Brandt Secretary Dan Wright Treasurer Kurt DeMaagd Curtis “Ovid” Poe Allison Randal Kevin Lenzo Director Emeritus Committee Chairs Alberto Simões Grants Heath Bair Conferences Mark Keating Marketing Ya’akov Sloman Community Advocacy Karen Pauley Steering The Perl Foundation 340 S Lemon Ave #6055 Walnut, CA 91789 The Perl Foundation is a business alias for The Yet Another Society, a 501-c-3 charitable organization, incorporated in the state of Michigan. A Look Inside: TPF Inside: A Look President’s Message This has been a great year for The Perl Foundation. Thanks to the generosity of our donors and corporate partners, the commitment of our volunteers, and the vitality and energy of our community, we have been able to continue in our mission to advance the Perl programming language. As you know, TPF depends on donations, both of time and money, to operate. These donations have made it possible for us to provide financial support to key developers of Perl 5 and Perl 6, to continue our efforts in protecting our trademark, and to support many community programs. One of the pillars of Perl is its community. We recently launched an initiative, the Community Advocacy Committee, targeting the growth and health of the Perl community. With the help of this committee we plan to not only improve communication within our own community but to expand our links with other F/OSS communities. This year has been one pointing to a great future for Perl and those who use it.
    [Show full text]
  • The Perl Review Perl Mongers News 5 Perl Foundation News 5 Perlwar
    The Perl Review 2.1 The Perl Review Volume 2, Issue 1 Winter 2005 Perl Mongers News 5 Editor / Publisher: brian d foy Perl Foundation News 5 Design: Eric Maki PerlWar 6 Columnists: David H. Adler Andy Lester The Seven Sins of Alberto Simões Perl OO Programming 10 Copy Editors: Mike Fragassi Perl News 16 Thomas Mackenzie Haskell for Perlers 18 www.theperlreview.com [email protected] Hash Anti-Patterns 26 The Perl Review Book Review 29 5250 N. Broadway Suite 157 Chicago, IL, 60640 Book Review 30 The Perl Review (ISSN 1553-667X) is published quarterly by brian d foy. Publication Office: 5301 N. Kenmore Ave #2, Chicago, IL 60640. US subscriber rate is $16 per year (4 issues). Foreign subscriber rate is $30 US per year (4 issues). Single copies are $5 in the US, $8 elsewhere. Postmaster: Send address changes to The Perl Review, 5250 N. Broadway Suite 157, Chicago, IL, 60640. Subscribers: Subscribe online or send a check or money order drawn in US funds to the above address. Advertisers: Send email to [email protected] for rates and information. On the Cover Long before people had computers, they'd sit at home and stitch their programs into cloth. It was a simpler time when Copyright © 2005 The Perl Review people were more careful with their code (always using All rights reserved. Individual articles may strictures) since the code was much harder to fix once they be available under other licenses. had finished the program. Programmers faced other difficulties, such as running out of the right color thread for their syntax Printed in Chicago, IL, USA.
    [Show full text]
  • Modern Perl, Fourth Edition
    Prepared exclusively for none ofyourbusiness Prepared exclusively for none ofyourbusiness Early Praise for Modern Perl, Fourth Edition A dozen years ago I was sure I knew what Perl looked like: unreadable and obscure. chromatic showed me beautiful, structured expressive code then. He’s the right guy to teach Modern Perl. He was writing it before it existed. ➤ Daniel Steinberg President, DimSumThinking, Inc. A tour de force of idiomatic code, Modern Perl teaches you not just “how” but also “why.” ➤ David Farrell Editor, PerlTricks.com If I had to pick a single book to teach Perl 5, this is the one I’d choose. As I read it, I was reminded of the first time I read K&R. It will teach everything that one needs to know to write Perl 5 well. ➤ David Golden Member, Perl 5 Porters, Autopragmatic, LLC I’m about to teach a new hire Perl using the first edition of Modern Perl. I’d much rather use the updated copy! ➤ Belden Lyman Principal Software Engineer, MediaMath It’s not the Perl book you deserve. It’s the Perl book you need. ➤ Gizmo Mathboy Co-founder, Greater Lafayette Open Source Symposium (GLOSSY) Prepared exclusively for none ofyourbusiness We've left this page blank to make the page numbers the same in the electronic and paper books. We tried just leaving it out, but then people wrote us to ask about the missing pages. Anyway, Eddy the Gerbil wanted to say “hello.” Prepared exclusively for none ofyourbusiness Modern Perl, Fourth Edition chromatic The Pragmatic Bookshelf Dallas, Texas • Raleigh, North Carolina Prepared exclusively for none ofyourbusiness Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks.
    [Show full text]
  • Name Synopsis
    Perl version 5.10.0 documentation - perl NAME perl - Practical Extraction and Report Language SYNOPSIS perl [ -sTtuUWX ] [ -hv ] [ -V[:configvar] ] [ -cw ] [ -d[t][:debugger] ] [ -D[number/list] ] [ -pna ] [ -F pattern ] [ -l[octal] ] [ -0[octal/hexadecimal] ] [ -Idir ] [ -m[-]module ] [ -M[-]'module...' ] [ -f ] [ -C [ number/list] ] [ -P ] [ -S ] [ -x[dir] ] [ -i[extension] ] [ -e 'command' ] [ -- ] [ programfile ] [ argument ]... If you're new to Perl, you should start with perlintro, which is a general intro for beginners and provides some background to help younavigate the rest of Perl's extensive documentation. For ease of access, the Perl manual has been split up into several sections. Overview perlPerl overview (this section) perlintroPerl introduction for beginners perltocPerl documentation table of contents Tutorials perlreftutPerl references short introduction perldscPerl data structures intro perllolPerl data structures: arrays of arrays perlrequick Perl regular expressions quick start perlretutPerl regular expressions tutorial perlbootPerl OO tutorial for beginners perltootPerl OO tutorial, part 1 perltoocPerl OO tutorial, part 2 perlbotPerl OO tricks and examples perlstylePerl style guide perlcheatPerl cheat sheet perltrapPerl traps for the unwary perldebtutPerl debugging tutorial perlfaqPerl frequently asked questions perlfaq1General Questions About Perl perlfaq2Obtaining and Learning about Perl perlfaq3Programming Tools perlfaq4Data Manipulation perlfaq5Files and Formats perlfaq6Regexes perlfaq7Perl Language Issues perlfaq8System
    [Show full text]
  • Module Kwalitee YAPC Europe 2007
    Module Kwalitee YAPC Europe 2007 v2.0 (translated, edited & augmented from French Perl Workshop 2006 talk) YAPC 2007, Vienna, August 28th–30th, 1 Xavier Caron <[email protected]> Module Kwalitee “Kwalitee”? ✗ Definition attempt ✗ “Kwalitee” is an approximation of “Quality” ✗ Nobody knows what it is actually... ✗ Anyway, we believe we're able to recognize it when we see it! ✗ It's mainly a matter of confidence ✗ Built through passed tests (but it's not enough as we'll see later) ✗ Yet, absence of bugs (read “unfound”) does not imply Kwalitee! ✗ Although a correlation exists if tests functional coverage is decent ✗ “Go ahead bug, make my day!” ✗ A bug is a difference between expectation and implementation ✗ It is also a difference between test, documentation & code ✗ If documentation is missing, this is a bug indeed! YAPC 2007, Vienna, August 28th–30th, 2 Xavier Caron <[email protected]> Module Kwalitee Achtung! * Tr ** Tr u (i th u n i th c s, lu is N d th in er O g t e T h i out i s s no t on h e)**tr er u e! th . YAPC 2007, Vienna, August 28th–30th, 3 Xavier Caron <[email protected]> Module Kwalitee When & What 1 ✗ Ages before ✗ Literature ✗ CPAN ✗ Articles, conferences, /Perl Mon(k|ger)s/, etc. ✗ “Read. Learn. Evolve.” – Klortho the Magnificent ✗ Before ✗ Generate module skeleton ✗ Use an OO class builder (if applicable) ✗ Write tests (a tad of XP in your code) ✗ While (coding) ✗ Document in parallel (and why not, before?) ✗ Add more tests if required YAPC 2007, Vienna, August 28th–30th, 4 Xavier Caron <[email protected]> Module Kwalitee When & What 2 ✗ After (between coding & release) ✗ Test (test suite – acceptance and non-regression) ✗ Measure POD coverage ✗ Measure tests code coverage ✗ Measure tests functional coverage (Ha! Ha!) ✗ Generate synthetic reports ✗ For one-glance checking purposes or for traceability's sake ✗ Way after (release) ✗ Refactor early, refactor often ✗ Test suite (non-regression) should ensure nothing got broken in the process ✗ Following a bug report..
    [Show full text]
  • Perl for System Administration
    Perl for System Administration Jacinta Richardson Paul Fenwick Perl for System Administration by Jacinta Richardson and Paul Fenwick Copyright © 2006-2008 Jacinta Richardson ([email protected]) Copyright © 2006-2008 Paul Fenwick ([email protected]) Copyright © 2006-2008 Perl Training Australia (http://perltraining.com.au) Conventions used throughout this text are based upon the conventions used in the Netizen training manuals by Kirrily Robert, and found at http://sourceforge.net/projects/spork Distribution of this work is prohibited unless prior permission is obtained from the copyright holder. This training manual is maintained by Perl Training Australia, and can be found at http://www.perltraining.com.au/notes.html. This is revision 1.2 of Perl Training Australia’s "Perl for System Administrators" training manual. Table of Contents 1. About Perl Training Australia....................................................................................................... 1 Training....................................................................................................................................... 1 Consulting ................................................................................................................................... 1 Contact us.................................................................................................................................... 1 2. Introduction....................................................................................................................................
    [Show full text]
  • SPEC CPU2006 Benchmark Descriptions
    SPEC CPU2006 Benchmark Descriptions Descriptions written by the SPEC CPU Subcommittee and by the original program authors [1]. Edited by John L. Henning, Secretary, SPEC CPU Subcommittee, and Performance Engineer, Sun Microsystems. Contact [email protected] Introduction tions, rather than using artificial loop kernels or synthetic benchmarks. Therefore, the most important parts of the new On August 24, 2006, the Standard Performance Evalua- suite are the benchmarks themselves, which are described on tion Corporation (SPEC) announced CPU2006 [2], which re- the pages that follow. In a future issue of Computer Architec- places CPU2000. The SPEC CPU benchmarks are widely used ture News, information will be provided about other aspects of in both industry and academia [3]. the new suite, including additional technical detail regarding The new suite is much larger than the previous, and will benchmark behavior and profiles. exercise new corners of CPUs, memory systems, and compil- ers – especially C++ compilers. Where CPU2000 had only 1 References: benchmark in C++, the new suite has 7, including one with ½ [1] Program authors are listed in the descriptions below, million lines of C++ code. As in previous CPU suites, Fortran which are adapted from longer versions posted at and C are also well represented. www.spec.org/cpu2006/Docs/. The SPEC project leaders Since its beginning, SPEC has claimed the motto that are listed in credits.html at the same location. [2] SPEC’s press announcement may be found at “An ounce of honest data www.spec.org/cpu2006/press/release.html is worth a pound of marketing hype”. [3] SPEC’s website has over 6000 published results for CPU2000, at www.spec.org/cpu2000/results.
    [Show full text]
  • Beginning Perl
    ffirs.indd ii 8/9/12 2:02 PM BEGINNING PERL INTRODUCTION . xxiii CHAPTER 1 What Is Perl? . .1 CHAPTER 2 Understanding the CPAN . 25 CHAPTER 3 Variables . .41 CHAPTER 4 Working with Data . 83 CHAPTER 5 Control Flow . 125 CHAPTER 6 References . 157 CHAPTER 7 Subroutines . 175 CHAPTER 8 Regular Expressions . 219 CHAPTER 9 Files and Directories . 249 CHAPTER 10 sort, map, and grep . 287 CHAPTER 11 Packages and Modules . 315 CHAPTER 12 Object Oriented Perl . 353 CHAPTER 13 Moose . 399 CHAPTER 14 Testing . 439 CHAPTER 15 The Interwebs . 481 CHAPTER 16 Databases . 523 CHAPTER 17 Plays Well with Others. 545 CHAPTER 18 Common Tasks . 567 CHAPTER 19 The Next Steps . .611 APPENDIX Answers to Exercises . 655 INDEX . 695 ffirs.indd i 8/9/12 2:02 PM ffirs.indd ii 8/9/12 2:02 PM BEGINNING Perl ffirs.indd iii 8/9/12 2:02 PM ffirs.indd iv 8/9/12 2:02 PM BEGINNING Perl Curtis “Ovid” Poe John Wiley & Sons, Inc. ffirs.indd v 8/9/12 2:02 PM Beginning Perl Published by John Wiley & Sons, Inc. 10475 Crosspoint Boulevard Indianapolis, IN 46256 w w w.wiley.com Copyright © 2012 by John Wiley & Sons, Inc., Indianapolis, Indiana Published simultaneously in Canada ISBN: 978-1-118-01384-7 ISBN: 978-1-118-22187-7 (ebk) ISBN: 978-1-118-23563-8 (ebk) ISBN: 978-1-118-26051-7 (ebk) Manufactured in the United States of America 10 9 8 7 6 5 4 3 2 1 No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning, or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600.
    [Show full text]
  • Introduction to Perl
    Introduction to Perl December 2019 Document reference: 3169-2019 #!/usr/local/bin/perl # # Find all the images that have been downloaded, and how often. # Store in a nested hash: filename -> size -> count use strict; use Data::Dumper; my %downloads; # Predeclare the hash while (<>) { next unless /Download/; # ignore everything thats not a download next if /imageBar/; # ignore downloads for the imageBar m!/hulton/(\w+?)/(.+\.jpg)!; # get the directory (size) and filename # If the filename doesn't exist, we need to create it. $downloads{$2} = {} unless defined $downloads{$2} $downloads{$2}->{$1}++; # increment filename -> size by one } $Data::Dumper::Indent = 3; # Define the padding for the output $Data::Dumper::Sortkeys = "true"; # Sort keys (default ASCII sort) print Dumper( \%downloads ); # display the gathered data 2019 Slide 1 of 70 Practical Extraction and Report Language ● Language for easy manipulation of ● text ● files ● processes ● Version 1.000 was released in 1987, version 5 came out in 1994. ● Unicode came in 2000, with Perl 5.6 ● Perl now release a major stable version upgrade annually (5.30.0 in 2019) ● Perl 6 started development in Summer 2005. ● NOT backward compatible ● OO and typed ● Released Christmas 2015 ● Officially renamed Raku in October 2019 2019 Slide 2 of 70 Overview ● Avoids inbuilt limits - uses full virtual memory ● Many defaults - does what you want ● Easy to do from the command prompt perl -e 'print "hello world\n"' ● Easy to do simple scripts #!/usr/local/bin/perl # a hello world script print “hello world\n”;
    [Show full text]
  • Strawberry Perl Manually Install Cpan Module
    Strawberry perl manually install cpan module Continue Strawberry Perl is a community-driven Open Source project, meaning that most people directly involved have jobs, families and/or other commitments beyond just strawberries. To maintain a sustainable long-term production distribution, we like to keep everything as simple and community driven as possible, so that our smart users can help each other and all the official features just work. So, a gentle reminder, you are among the friends here. And we'll do everything we can to help. But please be civil and understand some problems just haven't been solved yet, or haven't been included in strawberries, because current solutions just aren't reliable or sustainable enough yet, which is our top priority. And, of course, more assistants are always welcome :) Are you new to Pearl? learn.perl.org - Good starting point for Perl beginners Learn Perl in about 2 hours 30 minutes Modern Book Perl Do you have questions? #perl-help on irc.perl.org - Chat Live and get help from other developers perl #win32 on irc.perl.org - Chat Live if your windows-specific problem and get help from other Windows perl developers (you may need to wait until someone wakes up) Perl Monks or Stack overflow - often better quality answers than IRC for questions that aren't strawberry-specific. Mailing list - Great for offering new features, and offering to help write them, and developer stuff etc. Error reports If you have problems with packing strawberries, or anything broke out box, please file an error report (with as much details as possible) on our Tracker request, where you can also find already reported problems.
    [Show full text]
  • Introduction to Perl
    Introduction to Perl Instructor: Dr. Nicholas C. Maliszewskyj Textbook: Learning Perl on Win32 Systems (Schwartz, Olson & Christiansen) Resources: Programming Perl (Wall, Christiansen, & Schwartz) Perl in a Nutshell (Siever, Spainhour, & Patwardian) Perl Mongers http://www.perl.org/ Comprehensive Perl Archive Network http://www.cpan.org · Initializing 1. Introduction · Looping over elements · History & Uses · Sorting · Philosophy & Idioms · Resources 9. Pattern Matching · Regular expressions 2. Perl Basics · Matching and substitution · Script Naming · Atoms and assertions · Language Properties · Invocation 10. Subroutines and Functions · Structure & Invocation 3. Built-In Data Types · Parameter passing · Scalars, lists, & hashes · Scope · Variable contexts · Special variables (defaults) 11. Files and I/O · Understanding filehandles 4. Scalars · Predefined filehandles · Numbers (STDIN, STDOUT, STDERR) · Strings · Opening, closing, reading, writing 5. Basic Operators · Formats · Manipulating files · Types of operators · Operator precedence 12. Modules 6. Control Structures · Extending Perl functionality · Obtaining and installing · If-elsif-else, unless · Object-oriented Perl · Loops: do, while, until, for, foreach 13. CGI Programming · Labels: next, last · CGI Concepts · The infamous goto · Generating HTML 7. Lists · Passing parameters · Simple Forms · Initializing · Using the CGI.pm module · Accessing elements · Special operators 14. Advanced Topics 8. Associative Arrays (Hashes) · To be determined · Keys and values 1 Introduction What is Perl? Depending on whom you ask, Perl stands for “Practical Extraction and Report Language” or “Pathologically Eclectic Rubbish Lister.” It is a powerful glue language useful for tying together the loose ends of computing life. History Perl is the natural outgrowth of a project started by Larry Wall in 1986. Originally intended as a configuration and control system for six VAXes and six SUNs located on opposite ends of the country, it grew into a more general tool for system administration on many platforms.
    [Show full text]
  • Name Synopsis
    Perl version 5.10.1 documentation - perl NAME perl - Practical Extraction and Report Language SYNOPSIS perl [ -sTtuUWX ] [ -hv ] [ -V[:configvar] ] [ -cw ] [ -d[t][:debugger] ] [ -D[number/list] ] [ -pna ] [ -F pattern ] [ -l[octal] ] [ -0[octal/hexadecimal] ] [ -Idir ] [ -m[-]module ] [ -M[-]'module...' ] [ -f ] [ -C [ number/list] ] [ -P ] [ -S ] [ -x[dir] ] [ -i[extension] ] [ [-e|-E] 'command' ] [ -- ] [ programfile ] [ argument ]... If you're new to Perl, you should start with perlintro, which is a general intro for beginners and provides some background to help younavigate the rest of Perl's extensive documentation. For ease of access, the Perl manual has been split up into several sections. Overview perlPerl overview (this section) perlintroPerl introduction for beginners perltocPerl documentation table of contents Tutorials perlreftutPerl references short introduction perldscPerl data structures intro perllolPerl data structures: arrays of arrays perlrequick Perl regular expressions quick start perlretutPerl regular expressions tutorial perlbootPerl OO tutorial for beginners perltootPerl OO tutorial, part 1 perltoocPerl OO tutorial, part 2 perlbotPerl OO tricks and examples perlperfPerl Performance and Optimization Techniques perlstylePerl style guide perlcheatPerl cheat sheet perltrapPerl traps for the unwary perldebtutPerl debugging tutorial perlfaqPerl frequently asked questions perlfaq1General Questions About Perl perlfaq2Obtaining and Learning about Perl perlfaq3Programming Tools perlfaq4Data Manipulation perlfaq5Files and
    [Show full text]