SlideShare a Scribd company logo
Perl Tutorial

The Practical Extraction Report Language
• The premier site for Perl information is:

                  http://www.perl.com
• Everything you every wanted to know about Perl, and then some.
• Perl is a creation of Larry Wall

• Current stable release 5.005_03



                Copyright (c) 1999 by Paul Barry, IT Carlow, Kilkenny Road, Carlow, Ireland. All Rights Reserved.
What is Perl?
• A powerful general-purpose programming language
• A high-level, command-driven scripting language
        What is a Scripting Language?
• A programmer/administrator tool designed to allow the bolting
  together of other software tools to solve a problem - we refer to
  the resulting programs as scripts
• Scripts are very popular within the UNIX and Linux world
• Examples of scripting languages include TCL, Python, and
  AppleScript (and - of course - Perl!). MS-DOS batch files are a
  very simple, primitive form of scripts
• Scripting languages are generally interpreted, as opposed to
  compiled


                Copyright (c) 1999 by Paul Barry, IT Carlow, Kilkenny Road, Carlow, Ireland. All Rights Reserved.
What makes Perl different?
• Easy to learn - yippee! - with very good support for standard
  programming constructs
• Very good at processing and formatting text files (the reason it
  was created)
• Freely available, on many platforms (UNIX, Linux, Mac, PC,
  Irix, SunOS, Windows, NT, etc., etc.)
• Strong support from the Internet developer community
• Add-ons available for every conceivable usage - great support for
  Internet standards and protocols
       Why do Programmers like Perl?
• Lots of reasons ...
• Perl gets the job done!


                Copyright (c) 1999 by Paul Barry, IT Carlow, Kilkenny Road, Carlow, Ireland. All Rights Reserved.
A Perl Story #1
• When faced with writing a particularly mundane, but highly
  necessary, program to process thousands of files, a programmer
  was faced with choosing a language
• If he had had to write the program in C, he would have found an
  excuse not to
• If he had had to write the program in C++/Java, he would still be
  trying to identify the best set of abstractions to implement as
  classes
• He chose Perl, and wrote 12 lines of code in as many minutes ...




               Copyright (c) 1999 by Paul Barry, IT Carlow, Kilkenny Road, Carlow, Ireland. All Rights Reserved.
What is Perl not so good at?
• Writing low-level, machine dependent code, such as Device
  Drivers
• Highly compute-intensive, mathematical programs
• Highly optimised, time-critical programs (i.e., real-time,
  embedded)
            Why not use/learn Java?
• Good question! After all, Java is "the programming language of
  the Internet" and this is an Internet course!!
• More interested in learning about networking protocols, as
  opposed to programming languages that target the networking
  world
• Despite what you've heard, Java is not easy to master/learn
• Java is easier than C++, but that doesn't say much
• Java is cool, but, Perl is cooler!
               Copyright (c) 1999 by Paul Barry, IT Carlow, Kilkenny Road, Carlow, Ireland. All Rights Reserved.
Features of Perl
• Support got High-level Data-types
 dynamic list structures
 associative arrays ("hashes")
 strings
 references (a safer, and easier to use, version of C/C++ "pointers")

• Support for Regular Expressions
 sophisticated pattern-matching and replacement operations

• Automatic Memory Management
 no more worrying about malloc, new, free, dispose, delete [], etc., etc.

• Extensible
 OOP support (with Perl 5)
 reusable code base
 modular

• "Low-Level" Features
 possible to interface Perl to other programming languages (C, C++, Java)
 possible to embed the Perl interpreter in a program written in C

                    Copyright (c) 1999 by Paul Barry, IT Carlow, Kilkenny Road, Carlow, Ireland. All Rights Reserved.
Features of Perl (continued)
• Some Controversial Features
 "loose" typing and declarations (no need to pre-define variables)
 "There's more than one way to do it"
 performance can be poor (due to it's interpreted nature)
 "real" computer scientists tend to view Perl with disdain




                    Copyright (c) 1999 by Paul Barry, IT Carlow, Kilkenny Road, Carlow, Ireland. All Rights Reserved.
Perl Documentation
• I recommend a couple of textbooks on the Booklist as found on
  the http://elmo.itcarlow.ie website
• Every Perl distribution comes with complete on-line
  documentation
• On Linux, the "man perl" command introduces the documentation
  available
• The on-line reference material is to be regarded as the ultimate
  authority on what your distribution of Perl supports




               Copyright (c) 1999 by Paul Barry, IT Carlow, Kilkenny Road, Carlow, Ireland. All Rights Reserved.
A Perl Story #2
• A University in the States runs a programming challenge each
  year
• The first year it ran, a student using Perl won, completing the
  challenge in about half the time of any other student (all using
  more traditional programming languages)
• In all subsequent years, Perl programmers have been banned from
  the competition
• The winner from the first year still isn't quite sure what to do with
  his prize - a copy of "Microsoft Visual C++"




                Copyright (c) 1999 by Paul Barry, IT Carlow, Kilkenny Road, Carlow, Ireland. All Rights Reserved.

More Related Content

PPTX
perl lauange
PPTX
Bioinformatica p1-perl-introduction
PDF
Vimeo and Open Source (SMPTE Forum 2015)
PPTX
Future of PERL in IT
PDF
Defining DSL (Domain Specific Language) using Ruby
PDF
How to use Ruby code inside Elixir
PPTX
Plc part 1
PPTX
FFMS2: Indexing, Edge Cases, and Insanity
perl lauange
Bioinformatica p1-perl-introduction
Vimeo and Open Source (SMPTE Forum 2015)
Future of PERL in IT
Defining DSL (Domain Specific Language) using Ruby
How to use Ruby code inside Elixir
Plc part 1
FFMS2: Indexing, Edge Cases, and Insanity

What's hot (20)

PDF
Are High Level Programming Languages for Multicore and Safety Critical Conver...
PDF
Getting Started with SQL Server Compact Edition 3.51
PPTX
.NET MeetUp Amsterdam 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
PPTX
.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund
PDF
ctchou-resume
PPTX
Evolution of programming languages
PDF
Non-Blocking Strategies for FFI
PPTX
Introduction to python
PDF
The Roslyn Compiler: Look at Your Code from a Different Perspective (Raffaele...
PPT
CH # 1 preliminaries
PDF
ctchou-resume
PPTX
.NET MeetUp Prague 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
PPTX
.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
PPTX
.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund
PDF
Principles Of Programing Languages
PDF
ctchou-resume
PPTX
Top ten computer languages in 2018
ODP
PDQ Programming Languages plus an overview of Alice - Frank Ducrest
PPTX
Python Training in Pune
PDF
[Dec./2017] My Personal/Professional Journey after Graduate Univ.
Are High Level Programming Languages for Multicore and Safety Critical Conver...
Getting Started with SQL Server Compact Edition 3.51
.NET MeetUp Amsterdam 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Brno - Challenges of Managing CoreFX repo -- Karel Zikmund
ctchou-resume
Evolution of programming languages
Non-Blocking Strategies for FFI
Introduction to python
The Roslyn Compiler: Look at Your Code from a Different Perspective (Raffaele...
CH # 1 preliminaries
ctchou-resume
.NET MeetUp Prague 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET Fringe 2017 - Challenges of Managing CoreFX repo -- Karel Zikmund
.NET MeetUp Prague 2017 - .NET Standard -- Karel Zikmund
Principles Of Programing Languages
ctchou-resume
Top ten computer languages in 2018
PDQ Programming Languages plus an overview of Alice - Frank Ducrest
Python Training in Pune
[Dec./2017] My Personal/Professional Journey after Graduate Univ.
Ad

Viewers also liked (7)

PDF
Tutorial%20-%20Content%20Management%20System
PDF
PDF
eureka09
PDF
netbeans
PDF
User_Manual
PDF
IJTC%202009%20JRuby
Tutorial%20-%20Content%20Management%20System
eureka09
netbeans
User_Manual
IJTC%202009%20JRuby
Ad

Similar to Intro (20)

PDF
Perl 101
PPTX
introduction to Perl _ the programming language.pptx
PDF
Perl University: Getting Started with Perl
PDF
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTH
PPTX
PPTX
programming language interface i.pptx
PPTX
Group1_PERL.pptx
ODP
Add Perl to Your Toolbelt
PDF
Enterprise Perl
PPTX
PDF
Introduction to PERL Programming - Complete Notes
PPT
Perl Reference.ppt
PPTX
Unit 1-introduction to perl
ODP
Deluxe techperl
PDF
perltut
PDF
perltut
PPT
PERL - complete_Training_Modules_Ref.ppt
PPT
PERL - complete_guide_references (1).ppt
Perl 101
introduction to Perl _ the programming language.pptx
Perl University: Getting Started with Perl
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTH
programming language interface i.pptx
Group1_PERL.pptx
Add Perl to Your Toolbelt
Enterprise Perl
Introduction to PERL Programming - Complete Notes
Perl Reference.ppt
Unit 1-introduction to perl
Deluxe techperl
perltut
perltut
PERL - complete_Training_Modules_Ref.ppt
PERL - complete_guide_references (1).ppt

More from tutorialsruby (20)

PDF
<img src="../i/r_14.png" />
PDF
TopStyle Help & <b>Tutorial</b>
PDF
The Art Institute of Atlanta IMD 210 Fundamentals of Scripting <b>...</b>
PDF
<img src="../i/r_14.png" />
PDF
<img src="../i/r_14.png" />
PDF
Standardization and Knowledge Transfer – INS0
PDF
xhtml_basics
PDF
xhtml_basics
PDF
xhtml-documentation
PDF
xhtml-documentation
PDF
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
PDF
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
PDF
HowTo_CSS
PDF
HowTo_CSS
PDF
BloggingWithStyle_2008
PDF
BloggingWithStyle_2008
PDF
cascadingstylesheets
PDF
cascadingstylesheets
<img src="../i/r_14.png" />
TopStyle Help & <b>Tutorial</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" />
Standardization and Knowledge Transfer – INS0
xhtml_basics
xhtml_basics
xhtml-documentation
xhtml-documentation
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
0047ecaa6ea3e9ac0a13a2fe96f4de3bfd515c88f5d90c1fae79b956363d7f02c7fa060269
HowTo_CSS
HowTo_CSS
BloggingWithStyle_2008
BloggingWithStyle_2008
cascadingstylesheets
cascadingstylesheets

Recently uploaded (20)

PDF
Encapsulation theory and applications.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Machine learning based COVID-19 study performance prediction
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
Cloud computing and distributed systems.
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
MYSQL Presentation for SQL database connectivity
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
cuic standard and advanced reporting.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Spectral efficient network and resource selection model in 5G networks
Encapsulation theory and applications.pdf
Review of recent advances in non-invasive hemoglobin estimation
“AI and Expert System Decision Support & Business Intelligence Systems”
Machine learning based COVID-19 study performance prediction
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
NewMind AI Weekly Chronicles - August'25 Week I
Cloud computing and distributed systems.
Chapter 3 Spatial Domain Image Processing.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Empathic Computing: Creating Shared Understanding
MIND Revenue Release Quarter 2 2025 Press Release
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
MYSQL Presentation for SQL database connectivity
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
cuic standard and advanced reporting.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Spectral efficient network and resource selection model in 5G networks

Intro

  • 1. Perl Tutorial The Practical Extraction Report Language • The premier site for Perl information is: http://www.perl.com • Everything you every wanted to know about Perl, and then some. • Perl is a creation of Larry Wall • Current stable release 5.005_03 Copyright (c) 1999 by Paul Barry, IT Carlow, Kilkenny Road, Carlow, Ireland. All Rights Reserved.
  • 2. What is Perl? • A powerful general-purpose programming language • A high-level, command-driven scripting language What is a Scripting Language? • A programmer/administrator tool designed to allow the bolting together of other software tools to solve a problem - we refer to the resulting programs as scripts • Scripts are very popular within the UNIX and Linux world • Examples of scripting languages include TCL, Python, and AppleScript (and - of course - Perl!). MS-DOS batch files are a very simple, primitive form of scripts • Scripting languages are generally interpreted, as opposed to compiled Copyright (c) 1999 by Paul Barry, IT Carlow, Kilkenny Road, Carlow, Ireland. All Rights Reserved.
  • 3. What makes Perl different? • Easy to learn - yippee! - with very good support for standard programming constructs • Very good at processing and formatting text files (the reason it was created) • Freely available, on many platforms (UNIX, Linux, Mac, PC, Irix, SunOS, Windows, NT, etc., etc.) • Strong support from the Internet developer community • Add-ons available for every conceivable usage - great support for Internet standards and protocols Why do Programmers like Perl? • Lots of reasons ... • Perl gets the job done! Copyright (c) 1999 by Paul Barry, IT Carlow, Kilkenny Road, Carlow, Ireland. All Rights Reserved.
  • 4. A Perl Story #1 • When faced with writing a particularly mundane, but highly necessary, program to process thousands of files, a programmer was faced with choosing a language • If he had had to write the program in C, he would have found an excuse not to • If he had had to write the program in C++/Java, he would still be trying to identify the best set of abstractions to implement as classes • He chose Perl, and wrote 12 lines of code in as many minutes ... Copyright (c) 1999 by Paul Barry, IT Carlow, Kilkenny Road, Carlow, Ireland. All Rights Reserved.
  • 5. What is Perl not so good at? • Writing low-level, machine dependent code, such as Device Drivers • Highly compute-intensive, mathematical programs • Highly optimised, time-critical programs (i.e., real-time, embedded) Why not use/learn Java? • Good question! After all, Java is "the programming language of the Internet" and this is an Internet course!! • More interested in learning about networking protocols, as opposed to programming languages that target the networking world • Despite what you've heard, Java is not easy to master/learn • Java is easier than C++, but that doesn't say much • Java is cool, but, Perl is cooler! Copyright (c) 1999 by Paul Barry, IT Carlow, Kilkenny Road, Carlow, Ireland. All Rights Reserved.
  • 6. Features of Perl • Support got High-level Data-types dynamic list structures associative arrays ("hashes") strings references (a safer, and easier to use, version of C/C++ "pointers") • Support for Regular Expressions sophisticated pattern-matching and replacement operations • Automatic Memory Management no more worrying about malloc, new, free, dispose, delete [], etc., etc. • Extensible OOP support (with Perl 5) reusable code base modular • "Low-Level" Features possible to interface Perl to other programming languages (C, C++, Java) possible to embed the Perl interpreter in a program written in C Copyright (c) 1999 by Paul Barry, IT Carlow, Kilkenny Road, Carlow, Ireland. All Rights Reserved.
  • 7. Features of Perl (continued) • Some Controversial Features "loose" typing and declarations (no need to pre-define variables) "There's more than one way to do it" performance can be poor (due to it's interpreted nature) "real" computer scientists tend to view Perl with disdain Copyright (c) 1999 by Paul Barry, IT Carlow, Kilkenny Road, Carlow, Ireland. All Rights Reserved.
  • 8. Perl Documentation • I recommend a couple of textbooks on the Booklist as found on the http://elmo.itcarlow.ie website • Every Perl distribution comes with complete on-line documentation • On Linux, the "man perl" command introduces the documentation available • The on-line reference material is to be regarded as the ultimate authority on what your distribution of Perl supports Copyright (c) 1999 by Paul Barry, IT Carlow, Kilkenny Road, Carlow, Ireland. All Rights Reserved.
  • 9. A Perl Story #2 • A University in the States runs a programming challenge each year • The first year it ran, a student using Perl won, completing the challenge in about half the time of any other student (all using more traditional programming languages) • In all subsequent years, Perl programmers have been banned from the competition • The winner from the first year still isn't quite sure what to do with his prize - a copy of "Microsoft Visual C++" Copyright (c) 1999 by Paul Barry, IT Carlow, Kilkenny Road, Carlow, Ireland. All Rights Reserved.