SlideShare ist ein Scribd-Unternehmen logo
1 von 7
Downloaden Sie, um offline zu lesen
NodeTop, Next:Preface, Previous:(dir), Up:(dir)
    Preface:
    Overview of Perl:
    Scalars:
    Arrays:
    Control Structures:
    Associative Arrays (Hashes):
    Advanced Control Structures:
    Input and Output:
    Regular Expressions:
    Subroutines:
    File Input and Output:
    Directories:
    File System Manipulation:
    Formats:
    Using Modules:
    Going Further:
    General Index:

      --- The Detailed Node Listing ---

      Preface
      Purpose of this Book:
      Contributors:
      Obtaining the Most Recent Version:
      Audience: Who should read this book?
      Material Covered: What does this book cover?
      Conventions Used in this Book: How do I read this book?
      Where to Find Perl Information: Where can I get more information?

      Overview of Perl
      Perl Background: History and Philosophy of Perl.
      A First Perl Program: A Simple Example.
      Running Perl on Your System: How to run Perl.
      Expression Evaluation: How Perl expressions are evaluated.
      Overview Exercises: Exercises to learn from.

      Perl Background
      The History of Perl: Historical information on Perl.
      Perl as a Natural Language: How Perl can be considered a ``natural language''.
      The Slogans: Some common sayings that might help a new programmer understand Perl.

      Running Perl on Your System
      Perl on a Unix-like System: Using Perl in a Unix-like environment.
      Perl on a Microsoft Windows System: Using Perl on a Microsoft system.
      The Online Perl Documentation: Finding the documentation that comes with Perl.




                                                                                            Page 1
   Scalars
   Strings: Using strings of characters in Perl.
   Numbers: Using numerical values in Perl.
   Scalar Variables: Storing scalar data into variables.
   Operators: Operators that work on scalar data.
   Output of Scalar Data:
   Special Variables: Special scalar variables to be aware of.
   Summary of Scalar Operators:
   Scalar Exercises: Exercises to learn from.

   Strings
   Single-quoted Strings:
   A Digression---The print Function:
   Double-quoted Strings:
   Here Document Strings:

   Single-quoted Strings
   Special Characters in Single-quoted Strings:
   Newlines in Single-quoted Strings:
   Examples of Illegal Single-quoted Strings:

   Double-quoted Strings
   Interpolation in Double-quoted Strings:
   Examples of Interpolation:
   Examples of Interpolation (ASCII Octal Values):
   Examples of Interpolation (ASCII Hex Values):
   Characters Requiring Special Consideration:

   Numbers
   Numeric Literals: Numeric values in Perl

   Numeric Literals
   Printing Numeric Literals: Using print with numeric literals

   Scalar Variables
   Scalar Interpolation: Expanding scalar variables in double-quoted strings
   Undefined Variables: Before a Variable has a value, It is undefined

   Operators
   Numerical Operators: Operators for numeric scalars
   Comparison Operators: Operators to compare scalars with each other
   Auto-Increment and Decrement:
   String Operators: Operators for string scalars

   Arrays
   The Semantics of Arrays:
   List Literals:
   Array Variables:



                                                                                Page 2
   Manipulating Arrays and Lists:
   Array Exercises:

   Array Variables
   Using Array Variables:
   Associated Scalars:

   Manipulating Arrays and Lists
   It Slices!:
   Functions:
   The Context (List vs. Scalar):
   Array Interpolation:

   Functions
   Arrays as Stacks:
   Arrays as Queues:

   Control Structures
   Blocks:
   A Digression---Truth Values:
   The if/unless Structures:
   The while/until Structures:
   The do while/until Structures:
   The for Structure:
   The foreach Structure:
   Control Structure Exercises:

   Associative Arrays (Hashes)
   What Is It?:
   Hash Variables:
   Hash Literals:
   Hash Functions:
   Slices:
   Context Considerations:
   Hash Exercises:

   Functions
   Keys and Values:
   Each:

   Advanced Control Structures
   last and next:
   redo:
   Labeled Blocks:
   Expression Modifiers and Boolean Structures:
   Advanced Control Structure Exercises:

   Input and Output



                                                   Page 3
   STDOUT:
   STDIN:
   STDERR:
   Reading Input:
   Printing and Output:
   Special Variables for I/O:
   I/O Exercises:

   Regular Expressions
   The Theory Behind It All:
   The Simple:
   Pattern Matching:
   Regular Expression Shortcuts:
   Regular Expression Exercises:

   The Simple
   Simple Characters:
   The * Special Character:
   The . Character:
   The | Character:
   Grouping with ()s:
   The Anchor Characters:

   Subroutines
   Defining Subroutines:
   Returning Values:
   Using Arguments:
   Dynamic vs. Lexical Scoping:
   Subroutine Exercises:

   File Input and Output
   Filehandles:
   Open and Close:
   Easy Input and Output with Filehandles:
   File Tests:
   The stat Function:
   File I/O Exercises:

   Directories
   Moving Around:
   Globbing:
   Directory Handles:
   Reading Directory Information:
   Directory Exercises:

   File System Manipulation
   Renaming and Removing:
   Creation:



                                              Page 4
   Permissions:
       Timestamps:
       File System Exercises:

       Formats
       Format Exercises:

       Using Modules
       The use Pragma:
       Importing Functions:
       Controlling What Is Imported:
       A Module Example (CGI.pm):
       Useful Default Modules:
       Downloading and Installing CPAN Modules:


NodePreface, Next:Overview of Perl, Previous:Top, Up:Top



  Preface
       Purpose of this Book:
       Contributors:
       Obtaining the Most Recent Version:
       Audience: Who should read this book?
       Material Covered: What does this book cover?
       Conventions Used in this Book: How do I read this book?
       Where to Find Perl Information: Where can I get more information?


NodePurpose of this Book, Next:Contributors, Previous:Preface, Up:Preface


 Purpose of this Book
 This book has been created for a number of reasons. The primary reason is to provide a freely
redistributable tutorial for the Perl language. In writing a freely redistributable tutorial, it is our hope that
the largest number of people can have access to it and share it.

We are a community of Perl programmers. We have discovered ways to save time and money by writing
Perl programs that make our jobs and lives easier. Surely, Perl is not a panacea, but it has certainly made
our lives a little bit easier. It is our hope that you can use Perl to make your jobs and lives easier.


NodeContributors, Next:Obtaining the Most Recent Version, Previous:Purpose of this Book, Up:
Preface


 Contributors
Bradley M. Kuhn (bkuhn@ebb.org) served as "pumpking" (aka editor) for the first edition of this book.



                                                                                                                    Page 5
In addition, he wrote most of the chapters for the first edition.

Greg Bacon (gbacon@cs.uah.edu) was the first to provide grammar and error correcting patches to the
early, pre-release editions.


NodeObtaining the Most Recent Version, Next:Audience, Previous:Contributors, Up:Preface


 Obtaining the Most Recent Version
This book is still under development. The most recent version can be obtained at
http://www.ebb.org/PickingUpPerl.


NodeAudience, Next:Material Covered, Previous:Obtaining the Most Recent Version, Up:Preface


 Audience
 This book is designed for readers who are already competent programmers. Perl is a wonderful
programming language, but is really not the best choice for a first programming language. Since that is the
case, we have chosen to write this book for the audience of those who are already familiar with general
programming concepts, but are completely new to Perl.

This book does not that assume any prior knowledge of Perl. However, a reader familiar with standard
computer science concepts such as abstraction, stacks, queues, and hash tables will definitely find her
way through this book with ease. In other words, anyone with a knowledge equivalent to a first-year of
college computer science courses should find this book very basic, and those of less experience may find
it much more challenging.


NodeMaterial Covered, Next:Conventions Used in this Book, Previous:Audience, Up:Preface


 Material Covered
 The material covered in this book is designed to prepare the reader to enter the world of Perl
programming. This book covers the basic data and control structures of Perl, as well as the philosophies
behind Perl programming. The native search patterns used in Perl, called regular expressions, are
introduced and discussed. The basics of input and output and file system manipulation in Perl are
explained. Finally, a "real world" example of working with and using modules that other programmers
have written is given.


NodeConventions Used in this Book, Next:Where to Find Perl Information, Previous:Material Covered,
Up:Preface


 Conventions Used in this Book
In this text, a variety of conventions will be used to explain the material. Certain typographical and
display elements will be used for didactic purposes.



                                                                                                              Page 6
Any Perl code that is included directly in flowing text appears like this: code. Any operating system
commands or files that are discussed directly in the flowing text appear like this: file. When a particularly
term of importance is first introduced, they appear in emphasized text, like this: an important term.

When Perl code examples or operating system commands need to be separated away from the flowing
text for emphasis, or because the code is long, it appears like this:
my $x = "foo";           # This is a Perl assignment
p




                                                                                                                Page 7

Weitere ähnliche Inhalte

Was ist angesagt?

Rapid Prototyping with Solr
Rapid Prototyping with SolrRapid Prototyping with Solr
Rapid Prototyping with Solr
Erik Hatcher
 
Lucene for Solr Developers
Lucene for Solr DevelopersLucene for Solr Developers
Lucene for Solr Developers
Erik Hatcher
 
Improved Search With Lucene 4.0 - NOVA Lucene/Solr Meetup
Improved Search With Lucene 4.0 - NOVA Lucene/Solr MeetupImproved Search With Lucene 4.0 - NOVA Lucene/Solr Meetup
Improved Search With Lucene 4.0 - NOVA Lucene/Solr Meetup
rcmuir
 

Was ist angesagt? (20)

Neural Architectures for Named Entity Recognition
Neural Architectures for Named Entity RecognitionNeural Architectures for Named Entity Recognition
Neural Architectures for Named Entity Recognition
 
Flexible Indexing in Lucene 4.0
Flexible Indexing in Lucene 4.0Flexible Indexing in Lucene 4.0
Flexible Indexing in Lucene 4.0
 
Lucene and MySQL
Lucene and MySQLLucene and MySQL
Lucene and MySQL
 
The Evolution of Lucene & Solr Numerics from Strings to Points: Presented by ...
The Evolution of Lucene & Solr Numerics from Strings to Points: Presented by ...The Evolution of Lucene & Solr Numerics from Strings to Points: Presented by ...
The Evolution of Lucene & Solr Numerics from Strings to Points: Presented by ...
 
Rapid Prototyping with Solr
Rapid Prototyping with SolrRapid Prototyping with Solr
Rapid Prototyping with Solr
 
Lucene Introduction
Lucene IntroductionLucene Introduction
Lucene Introduction
 
Introduction to libre « fulltext » technology
Introduction to libre « fulltext » technologyIntroduction to libre « fulltext » technology
Introduction to libre « fulltext » technology
 
Apache Lucene: Searching the Web and Everything Else (Jazoon07)
Apache Lucene: Searching the Web and Everything Else (Jazoon07)Apache Lucene: Searching the Web and Everything Else (Jazoon07)
Apache Lucene: Searching the Web and Everything Else (Jazoon07)
 
Google Protocol Buffers
Google Protocol BuffersGoogle Protocol Buffers
Google Protocol Buffers
 
Intro to nlp
Intro to nlpIntro to nlp
Intro to nlp
 
Lucene for Solr Developers
Lucene for Solr DevelopersLucene for Solr Developers
Lucene for Solr Developers
 
Improved Search With Lucene 4.0 - NOVA Lucene/Solr Meetup
Improved Search With Lucene 4.0 - NOVA Lucene/Solr MeetupImproved Search With Lucene 4.0 - NOVA Lucene/Solr Meetup
Improved Search With Lucene 4.0 - NOVA Lucene/Solr Meetup
 
What is in a Lucene index?
What is in a Lucene index?What is in a Lucene index?
What is in a Lucene index?
 
Lucene indexing
Lucene indexingLucene indexing
Lucene indexing
 
Word2 vec
Word2 vecWord2 vec
Word2 vec
 
Faceted Search with Lucene
Faceted Search with LuceneFaceted Search with Lucene
Faceted Search with Lucene
 
How the Lucene More Like This Works
How the Lucene More Like This WorksHow the Lucene More Like This Works
How the Lucene More Like This Works
 
Get the most out of Solr search with PHP
Get the most out of Solr search with PHPGet the most out of Solr search with PHP
Get the most out of Solr search with PHP
 
Text similarity measures
Text similarity measuresText similarity measures
Text similarity measures
 
Munching & crunching - Lucene index post-processing
Munching & crunching - Lucene index post-processingMunching & crunching - Lucene index post-processing
Munching & crunching - Lucene index post-processing
 

Andere mochten auch (8)

World Famous Prayer Interpretation By Dr
World  Famous  Prayer  Interpretation By  DrWorld  Famous  Prayer  Interpretation By  Dr
World Famous Prayer Interpretation By Dr
 
11 16 Biofuels
11 16 Biofuels11 16 Biofuels
11 16 Biofuels
 
Dojo Basics Js UserGroup Chicago
Dojo Basics Js UserGroup ChicagoDojo Basics Js UserGroup Chicago
Dojo Basics Js UserGroup Chicago
 
Freedom to perform in government- case of TePP
Freedom to perform in government- case of TePPFreedom to perform in government- case of TePP
Freedom to perform in government- case of TePP
 
Circolare del 22/06/2006 n. 23 Oggetto: Studi di settore. Periodo d'imposta 2005
Circolare del 22/06/2006 n. 23 Oggetto: Studi di settore. Periodo d'imposta 2005Circolare del 22/06/2006 n. 23 Oggetto: Studi di settore. Periodo d'imposta 2005
Circolare del 22/06/2006 n. 23 Oggetto: Studi di settore. Periodo d'imposta 2005
 
e6
e6e6
e6
 
11 20 Brambles
11 20 Brambles11 20 Brambles
11 20 Brambles
 
Beware Of Meditation Dr Shriniwas Kashalikar
Beware Of Meditation Dr Shriniwas KashalikarBeware Of Meditation Dr Shriniwas Kashalikar
Beware Of Meditation Dr Shriniwas Kashalikar
 

Ähnlich wie Perl%20Tutorial.!Picking%20Up%20Perl

Introduction to Linux Slides.pptx
Introduction to Linux Slides.pptxIntroduction to Linux Slides.pptx
Introduction to Linux Slides.pptx
hazhamina
 
Lpi Part 2 Basic Administration
Lpi Part 2 Basic AdministrationLpi Part 2 Basic Administration
Lpi Part 2 Basic Administration
YemenLinux
 
Clojure beasts-euroclj-2014
Clojure beasts-euroclj-2014Clojure beasts-euroclj-2014
Clojure beasts-euroclj-2014
Renzo Borgatti
 

Ähnlich wie Perl%20Tutorial.!Picking%20Up%20Perl (20)

Modules of the twenties
Modules of the twentiesModules of the twenties
Modules of the twenties
 
Introduction to Linux Slides.pptx
Introduction to Linux Slides.pptxIntroduction to Linux Slides.pptx
Introduction to Linux Slides.pptx
 
What we can learn from Rebol?
What we can learn from Rebol?What we can learn from Rebol?
What we can learn from Rebol?
 
presentation_intro_to_python
presentation_intro_to_pythonpresentation_intro_to_python
presentation_intro_to_python
 
presentation_intro_to_python_1462930390_181219.ppt
presentation_intro_to_python_1462930390_181219.pptpresentation_intro_to_python_1462930390_181219.ppt
presentation_intro_to_python_1462930390_181219.ppt
 
Lpi Part 2 Basic Administration
Lpi Part 2 Basic AdministrationLpi Part 2 Basic Administration
Lpi Part 2 Basic Administration
 
OOP, Networking, Linux/Unix
OOP, Networking, Linux/UnixOOP, Networking, Linux/Unix
OOP, Networking, Linux/Unix
 
The Why and What of Pattern Lab
The Why and What of Pattern LabThe Why and What of Pattern Lab
The Why and What of Pattern Lab
 
The Bund language
The Bund languageThe Bund language
The Bund language
 
web programming Unit VI PPT by Bhavsingh Maloth
web programming Unit VI PPT  by Bhavsingh Malothweb programming Unit VI PPT  by Bhavsingh Maloth
web programming Unit VI PPT by Bhavsingh Maloth
 
Managing JSON Deliverables with Fuzzy String-Matching Logic and the Path Reader
Managing JSON Deliverables with Fuzzy String-Matching Logic and the Path ReaderManaging JSON Deliverables with Fuzzy String-Matching Logic and the Path Reader
Managing JSON Deliverables with Fuzzy String-Matching Logic and the Path Reader
 
Summer Training Project On Python Programming
Summer Training Project On Python ProgrammingSummer Training Project On Python Programming
Summer Training Project On Python Programming
 
Linux programming - Getting self started
Linux programming - Getting self started Linux programming - Getting self started
Linux programming - Getting self started
 
Avro
AvroAvro
Avro
 
Parser
ParserParser
Parser
 
SF Python Meetup: TextRank in Python
SF Python Meetup: TextRank in PythonSF Python Meetup: TextRank in Python
SF Python Meetup: TextRank in Python
 
Files in Python.pptx
Files in Python.pptxFiles in Python.pptx
Files in Python.pptx
 
Files in Python.pptx
Files in Python.pptxFiles in Python.pptx
Files in Python.pptx
 
PYTHON PPT.pptx
PYTHON PPT.pptxPYTHON PPT.pptx
PYTHON PPT.pptx
 
Clojure beasts-euroclj-2014
Clojure beasts-euroclj-2014Clojure beasts-euroclj-2014
Clojure beasts-euroclj-2014
 

Mehr von tutorialsruby

<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
tutorialsruby
 
TopStyle Help & <b>Tutorial</b>
TopStyle Help & <b>Tutorial</b>TopStyle Help & <b>Tutorial</b>
TopStyle Help & <b>Tutorial</b>
tutorialsruby
 
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
tutorialsruby
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
tutorialsruby
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
tutorialsruby
 
Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0
tutorialsruby
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
tutorialsruby
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
tutorialsruby
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
tutorialsruby
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
tutorialsruby
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
tutorialsruby
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
tutorialsruby
 

Mehr von tutorialsruby (20)

<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
 
TopStyle Help & <b>Tutorial</b>
TopStyle Help & <b>Tutorial</b>TopStyle Help & <b>Tutorial</b>
TopStyle Help & <b>Tutorial</b>
 
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
 
Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0Standardization and Knowledge Transfer – INS0
Standardization and Knowledge Transfer – INS0
 
xhtml_basics
xhtml_basicsxhtml_basics
xhtml_basics
 
xhtml_basics
xhtml_basicsxhtml_basics
xhtml_basics
 
xhtml-documentation
xhtml-documentationxhtml-documentation
xhtml-documentation
 
xhtml-documentation
xhtml-documentationxhtml-documentation
xhtml-documentation
 
CSS
CSSCSS
CSS
 
CSS
CSSCSS
CSS
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
 
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa0602690047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
 
HowTo_CSS
HowTo_CSSHowTo_CSS
HowTo_CSS
 
HowTo_CSS
HowTo_CSSHowTo_CSS
HowTo_CSS
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
 
BloggingWithStyle_2008
BloggingWithStyle_2008BloggingWithStyle_2008
BloggingWithStyle_2008
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 

Kürzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Kürzlich hochgeladen (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

Perl%20Tutorial.!Picking%20Up%20Perl

  • 1. NodeTop, Next:Preface, Previous:(dir), Up:(dir)  Preface:  Overview of Perl:  Scalars:  Arrays:  Control Structures:  Associative Arrays (Hashes):  Advanced Control Structures:  Input and Output:  Regular Expressions:  Subroutines:  File Input and Output:  Directories:  File System Manipulation:  Formats:  Using Modules:  Going Further:  General Index:  --- The Detailed Node Listing ---  Preface  Purpose of this Book:  Contributors:  Obtaining the Most Recent Version:  Audience: Who should read this book?  Material Covered: What does this book cover?  Conventions Used in this Book: How do I read this book?  Where to Find Perl Information: Where can I get more information?  Overview of Perl  Perl Background: History and Philosophy of Perl.  A First Perl Program: A Simple Example.  Running Perl on Your System: How to run Perl.  Expression Evaluation: How Perl expressions are evaluated.  Overview Exercises: Exercises to learn from.  Perl Background  The History of Perl: Historical information on Perl.  Perl as a Natural Language: How Perl can be considered a ``natural language''.  The Slogans: Some common sayings that might help a new programmer understand Perl.  Running Perl on Your System  Perl on a Unix-like System: Using Perl in a Unix-like environment.  Perl on a Microsoft Windows System: Using Perl on a Microsoft system.  The Online Perl Documentation: Finding the documentation that comes with Perl. Page 1
  • 2. Scalars  Strings: Using strings of characters in Perl.  Numbers: Using numerical values in Perl.  Scalar Variables: Storing scalar data into variables.  Operators: Operators that work on scalar data.  Output of Scalar Data:  Special Variables: Special scalar variables to be aware of.  Summary of Scalar Operators:  Scalar Exercises: Exercises to learn from.  Strings  Single-quoted Strings:  A Digression---The print Function:  Double-quoted Strings:  Here Document Strings:  Single-quoted Strings  Special Characters in Single-quoted Strings:  Newlines in Single-quoted Strings:  Examples of Illegal Single-quoted Strings:  Double-quoted Strings  Interpolation in Double-quoted Strings:  Examples of Interpolation:  Examples of Interpolation (ASCII Octal Values):  Examples of Interpolation (ASCII Hex Values):  Characters Requiring Special Consideration:  Numbers  Numeric Literals: Numeric values in Perl  Numeric Literals  Printing Numeric Literals: Using print with numeric literals  Scalar Variables  Scalar Interpolation: Expanding scalar variables in double-quoted strings  Undefined Variables: Before a Variable has a value, It is undefined  Operators  Numerical Operators: Operators for numeric scalars  Comparison Operators: Operators to compare scalars with each other  Auto-Increment and Decrement:  String Operators: Operators for string scalars  Arrays  The Semantics of Arrays:  List Literals:  Array Variables: Page 2
  • 3. Manipulating Arrays and Lists:  Array Exercises:  Array Variables  Using Array Variables:  Associated Scalars:  Manipulating Arrays and Lists  It Slices!:  Functions:  The Context (List vs. Scalar):  Array Interpolation:  Functions  Arrays as Stacks:  Arrays as Queues:  Control Structures  Blocks:  A Digression---Truth Values:  The if/unless Structures:  The while/until Structures:  The do while/until Structures:  The for Structure:  The foreach Structure:  Control Structure Exercises:  Associative Arrays (Hashes)  What Is It?:  Hash Variables:  Hash Literals:  Hash Functions:  Slices:  Context Considerations:  Hash Exercises:  Functions  Keys and Values:  Each:  Advanced Control Structures  last and next:  redo:  Labeled Blocks:  Expression Modifiers and Boolean Structures:  Advanced Control Structure Exercises:  Input and Output Page 3
  • 4. STDOUT:  STDIN:  STDERR:  Reading Input:  Printing and Output:  Special Variables for I/O:  I/O Exercises:  Regular Expressions  The Theory Behind It All:  The Simple:  Pattern Matching:  Regular Expression Shortcuts:  Regular Expression Exercises:  The Simple  Simple Characters:  The * Special Character:  The . Character:  The | Character:  Grouping with ()s:  The Anchor Characters:  Subroutines  Defining Subroutines:  Returning Values:  Using Arguments:  Dynamic vs. Lexical Scoping:  Subroutine Exercises:  File Input and Output  Filehandles:  Open and Close:  Easy Input and Output with Filehandles:  File Tests:  The stat Function:  File I/O Exercises:  Directories  Moving Around:  Globbing:  Directory Handles:  Reading Directory Information:  Directory Exercises:  File System Manipulation  Renaming and Removing:  Creation: Page 4
  • 5. Permissions:  Timestamps:  File System Exercises:  Formats  Format Exercises:  Using Modules  The use Pragma:  Importing Functions:  Controlling What Is Imported:  A Module Example (CGI.pm):  Useful Default Modules:  Downloading and Installing CPAN Modules: NodePreface, Next:Overview of Perl, Previous:Top, Up:Top Preface  Purpose of this Book:  Contributors:  Obtaining the Most Recent Version:  Audience: Who should read this book?  Material Covered: What does this book cover?  Conventions Used in this Book: How do I read this book?  Where to Find Perl Information: Where can I get more information? NodePurpose of this Book, Next:Contributors, Previous:Preface, Up:Preface Purpose of this Book This book has been created for a number of reasons. The primary reason is to provide a freely redistributable tutorial for the Perl language. In writing a freely redistributable tutorial, it is our hope that the largest number of people can have access to it and share it. We are a community of Perl programmers. We have discovered ways to save time and money by writing Perl programs that make our jobs and lives easier. Surely, Perl is not a panacea, but it has certainly made our lives a little bit easier. It is our hope that you can use Perl to make your jobs and lives easier. NodeContributors, Next:Obtaining the Most Recent Version, Previous:Purpose of this Book, Up: Preface Contributors Bradley M. Kuhn (bkuhn@ebb.org) served as "pumpking" (aka editor) for the first edition of this book. Page 5
  • 6. In addition, he wrote most of the chapters for the first edition. Greg Bacon (gbacon@cs.uah.edu) was the first to provide grammar and error correcting patches to the early, pre-release editions. NodeObtaining the Most Recent Version, Next:Audience, Previous:Contributors, Up:Preface Obtaining the Most Recent Version This book is still under development. The most recent version can be obtained at http://www.ebb.org/PickingUpPerl. NodeAudience, Next:Material Covered, Previous:Obtaining the Most Recent Version, Up:Preface Audience This book is designed for readers who are already competent programmers. Perl is a wonderful programming language, but is really not the best choice for a first programming language. Since that is the case, we have chosen to write this book for the audience of those who are already familiar with general programming concepts, but are completely new to Perl. This book does not that assume any prior knowledge of Perl. However, a reader familiar with standard computer science concepts such as abstraction, stacks, queues, and hash tables will definitely find her way through this book with ease. In other words, anyone with a knowledge equivalent to a first-year of college computer science courses should find this book very basic, and those of less experience may find it much more challenging. NodeMaterial Covered, Next:Conventions Used in this Book, Previous:Audience, Up:Preface Material Covered The material covered in this book is designed to prepare the reader to enter the world of Perl programming. This book covers the basic data and control structures of Perl, as well as the philosophies behind Perl programming. The native search patterns used in Perl, called regular expressions, are introduced and discussed. The basics of input and output and file system manipulation in Perl are explained. Finally, a "real world" example of working with and using modules that other programmers have written is given. NodeConventions Used in this Book, Next:Where to Find Perl Information, Previous:Material Covered, Up:Preface Conventions Used in this Book In this text, a variety of conventions will be used to explain the material. Certain typographical and display elements will be used for didactic purposes. Page 6
  • 7. Any Perl code that is included directly in flowing text appears like this: code. Any operating system commands or files that are discussed directly in the flowing text appear like this: file. When a particularly term of importance is first introduced, they appear in emphasized text, like this: an important term. When Perl code examples or operating system commands need to be separated away from the flowing text for emphasis, or because the code is long, it appears like this: my $x = "foo"; # This is a Perl assignment p Page 7