SlideShare a Scribd company logo
Introduction To PERL Language



      Abhishek Pachisia
       B.Tech-IT (4th yr)
FOREWORD

   Original name Pearl.
   Perl is a high-level, general-purpose, interpreted, dynamic
    programming language.
   Perl is a programming language suitable for writing simple
    scripts as well as complex applications.
   Perl is not officially an acronym.
   Perl was originally developed by Larry Wall in 1987 as a
    general-purpose Unix scripting language
   According to Wall, Perl has two slogans.
     "There's more than one way to do it“.
     "Easy things should be easy and hard things should be
      possible"
BRIEF HISTORY
 PERL 1 - Released on December 18, 1987.
 PERL 2 - Released in 1988. Better regular
           expression engine.
 PERL 3 - Released in 1989. Support for binary
            data streams.
 PERL 4 - Released in 1991. To identify the
           version.
 Programming Perl -1991. Known as Camel Book.

 PERL 4.036 – Released in 1993.

 CPAN – 26 October, 1995.
VERSIONS OF PERL 5
   PERL 5 porters – Released on May,1994.
   PERL 5.000 - October 17,1994. Rewrite of
                  the interpreter + Many new features.
   PERL 5.001 - March 13,1995.
   PERL 5.002 - February 29,1996. New prototypes
                 feature
   PERL 5.003 - June 25,1996. Security release.
   PERL 5.004 - May 15,1997.Included UNIVERSAL
                 package
   PERL 5.005 - July 22,1998.Regex engine
   PERL 5.6 – March 22,2000. 64-bit
       support, Unicode string representation etc.
SYMBOLS
   Dromedary Camel
       Non-Commercial.




   Onion
       Licenses to its subsidiaries.
FEATURES
 The overall structure of Perl derives broadly from C.
 Perl also takes features from shell programming.

 All variables are marked with leading sigils.

 It has many built-in functions.

 Perl takes
       Lists from Lisp,
       Hashes ("associative arrays") from AWK, and
       Regular expressions from sed.
FEATURES THAT EASE TASK OF PROGRAMMER

 Automatic memory management,
 Dynamic typing,

 Strings,

 Lists, and hashes,

 Regular expressions,

 Introspection and

 An eval() function.
DESIGN - 1
   Response to three broad trends in the computer
    industry –
     Falling hardware costs,
     Rising labour costs, and
     Improvements in compiler technology.

 Make efficient use of expensive computer-
  programmers.
 No built-in limits similar to the Zero One Infinity rule.

 Syntax reflects the idea that "things that are
  different should look different”
DESIGN - 2
 Perl favours language constructs that are concise
  and natural for humans to write.
 Perl does not enforce any particular programming
  paradigm.
 Not    a tidy language. Resolve syntactical
  ambiguities.
 No written specification/standard through Perl 5

 That   interpreter, together with its functional
  tests, stands as a de facto specification of the
  language.
IMPLEMENTATION - 1
 Implemented as a core interpreter, written in C.
 The interpreter is 150,000 lines of C code and
  compiles to a 1 MB executable on typical machine
  architectures.
 The interpreter has an object-oriented architecture.
 All of the elements are represented in the
  interpreter by C structs.
 The life of a Perl interpreter divides broadly into a
  compile phase and a run phase.
 In compile phase , Compilation occurs.
 In run phase, Execution occurs.
IMPLEMENTATION-2
 At compile time, the interpreter parses Perl code
  into a syntax tree.
 At run time, it executes the program by walking the
  tree.
 Text is parsed only once, and the syntax tree is
  subject to optimization before it is executed.
 It is often said that “Only Perl can parse Perl”.

 Perl makes the unusual choice of giving the user
  access to its full programming power in its own
  compile phase.
 The cost in terms of theoretical purity is high, but
  practical inconvenience seems to be rare.
CPAN
   Comprehensive Perl Archive Network.
   An archive of over 114,000 modules of software
    written in Perl, as well as documentation for it.
   CPAN can denote
     Archive network itself, or
     The Perl program that acts as an interface to the network
      and as an automated software installer
   Most software on CPAN is free and open source
    software.
   Components:
     Mirrors
     Search engines
     Testers
     CPAN.pm and CPANPLUS
COMPLEX PERL PROGRAM
#!/usr/bin/perl
use strict;
use warnings;
use Time::HiRes qw(sleep time);
use POSIX qw();
use IO::Handle;

my $delay = shift(@ARGV);

STDOUT->autoflush(1);
{
  my $start = time();
  my $end = $start + $delay;
my $last_printed;
  while ((my $t = time()) < $end)
  {
       my $new_to_print = POSIX::floor($end - $t);

       if (!defined($last_printed) or $new_to_print !=
  $last_printed)
       {
                $last_printed = $new_to_print;
                print "Remaining $new_to_print/$delay", ' '
  x 40, "r";
       }
  sleep(0.1);
  }
}
print "n";
Perl

More Related Content

PPT
Os Worthington
oscon2007
 
PPTX
perl lauange
Naga Dinesh
 
PPT
High Performance Erlang
didip
 
PDF
1 hour dive into Erlang/OTP
Jordi Llonch
 
PPT
Porting To Symbian
Mark Wilcox
 
PDF
An Introduction to Hamler
EMQ
 
PPT
Al2ed chapter5
Abdullelah Al-Fahad
 
PPTX
Pearl
Naga Dinesh
 
Os Worthington
oscon2007
 
perl lauange
Naga Dinesh
 
High Performance Erlang
didip
 
1 hour dive into Erlang/OTP
Jordi Llonch
 
Porting To Symbian
Mark Wilcox
 
An Introduction to Hamler
EMQ
 
Al2ed chapter5
Abdullelah Al-Fahad
 

What's hot (8)

PDF
Lecture 1 Compiler design , computation
Rebaz Najeeb
 
DOCX
Ecet 330 Enthusiastic Study / snaptutorial.com
Stephenson033
 
PDF
Implementation - Sample Runs
Adwiteeya Agrawal
 
PDF
MPI - 1
Shah Zaib
 
PDF
How to use Ruby code inside Elixir
Weverton Timoteo
 
ODP
Firebird Python Drivers: Current state and future
Mind The Firebird
 
Lecture 1 Compiler design , computation
Rebaz Najeeb
 
Ecet 330 Enthusiastic Study / snaptutorial.com
Stephenson033
 
Implementation - Sample Runs
Adwiteeya Agrawal
 
MPI - 1
Shah Zaib
 
How to use Ruby code inside Elixir
Weverton Timoteo
 
Firebird Python Drivers: Current state and future
Mind The Firebird
 
Ad

Viewers also liked (20)

PPTX
Top Management of 5 recognized comapanies
Abhishek Pachisia
 
PPTX
Boeing- The Frontiers
Abhishek Pachisia
 
PPTX
Cloud Service Models
Abhishek Pachisia
 
PPTX
Fourier transform
Abhishek Pachisia
 
PPTX
File System Implementation
Abhishek Pachisia
 
PPTX
Rms titanic
Abhishek Pachisia
 
PPTX
Telecom Industry
Abhishek Pachisia
 
PPTX
V.G. siddhartha
Abhishek Pachisia
 
PPTX
Strategic alignment model (SAM)
Abhishek Pachisia
 
PPTX
Vb.net (loop structure)
Abhishek Pachisia
 
PPTX
Matrix Representation Of Graph
Abhishek Pachisia
 
PPTX
Hydrogen energy
Abhishek Pachisia
 
PPTX
Inference engine
Abhishek Pachisia
 
PPTX
Exception handling in Java
Abhishek Pachisia
 
PPTX
Work breakdown structure
Abhishek Pachisia
 
PPTX
IEEE 802.11
Abhishek Pachisia
 
PPT
Expert Systems
osmancikk
 
PPTX
Program Evaluation and Review Technique (PERT)
Abhishek Pachisia
 
Top Management of 5 recognized comapanies
Abhishek Pachisia
 
Boeing- The Frontiers
Abhishek Pachisia
 
Cloud Service Models
Abhishek Pachisia
 
Fourier transform
Abhishek Pachisia
 
File System Implementation
Abhishek Pachisia
 
Rms titanic
Abhishek Pachisia
 
Telecom Industry
Abhishek Pachisia
 
V.G. siddhartha
Abhishek Pachisia
 
Strategic alignment model (SAM)
Abhishek Pachisia
 
Vb.net (loop structure)
Abhishek Pachisia
 
Matrix Representation Of Graph
Abhishek Pachisia
 
Hydrogen energy
Abhishek Pachisia
 
Inference engine
Abhishek Pachisia
 
Exception handling in Java
Abhishek Pachisia
 
Work breakdown structure
Abhishek Pachisia
 
IEEE 802.11
Abhishek Pachisia
 
Expert Systems
osmancikk
 
Program Evaluation and Review Technique (PERT)
Abhishek Pachisia
 
Ad

Similar to Perl (20)

PPTX
introduction to Perl _ the programming language.pptx
gayathriaddula502
 
PDF
Enterprise Perl
Dave Cross
 
PDF
Intro
tutorialsruby
 
PDF
Intro
tutorialsruby
 
PPTX
Unit 1-introduction to perl
sana mateen
 
PPTX
Group1_PERL.pptx
Nahian Sarower
 
PDF
Perl 101
Alex Balhatchet
 
PPTX
programming language interface i.pptx
urvashipundir04
 
PPTX
Perl
Ahmed Hmed
 
PPT
Introduction to perl_ a scripting language
Vamshi Santhapuri
 
PDF
perltut
tutorialsruby
 
PDF
perltut
tutorialsruby
 
PDF
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTH
Bhavsingh Maloth
 
PDF
Introduction to PERL Programming - Complete Notes
Jason J Pulikkottil
 
PPT
PERL - complete_Training_Modules_Ref.ppt
ssuserf4000e1
 
PPT
PERL - complete_guide_references (1).ppt
ssuserf4000e1
 
PPT
Perl Reference.ppt
AshleshaKulkarni4
 
PPTX
python and perl
Mara Angelica Refraccion
 
PDF
perl
tutorialsruby
 
introduction to Perl _ the programming language.pptx
gayathriaddula502
 
Enterprise Perl
Dave Cross
 
Unit 1-introduction to perl
sana mateen
 
Group1_PERL.pptx
Nahian Sarower
 
Perl 101
Alex Balhatchet
 
programming language interface i.pptx
urvashipundir04
 
Introduction to perl_ a scripting language
Vamshi Santhapuri
 
perltut
tutorialsruby
 
perltut
tutorialsruby
 
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTH
Bhavsingh Maloth
 
Introduction to PERL Programming - Complete Notes
Jason J Pulikkottil
 
PERL - complete_Training_Modules_Ref.ppt
ssuserf4000e1
 
PERL - complete_guide_references (1).ppt
ssuserf4000e1
 
Perl Reference.ppt
AshleshaKulkarni4
 
python and perl
Mara Angelica Refraccion
 

Recently uploaded (20)

PPTX
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
PPTX
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
PPTX
Applications of matrices In Real Life_20250724_091307_0000.pptx
gehlotkrish03
 
PPTX
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
PDF
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
PPTX
Care of patients with elImination deviation.pptx
AneetaSharma15
 
PPTX
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 
PDF
Module 2: Public Health History [Tutorial Slides]
JonathanHallett4
 
DOCX
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 
PDF
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
PPTX
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
PDF
Virat Kohli- the Pride of Indian cricket
kushpar147
 
PPTX
Continental Accounting in Odoo 18 - Odoo Slides
Celine George
 
PPTX
INTESTINALPARASITES OR WORM INFESTATIONS.pptx
PRADEEP ABOTHU
 
PPTX
How to Track Skills & Contracts Using Odoo 18 Employee
Celine George
 
PPTX
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
PPTX
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
PPTX
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
PDF
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
PPTX
Command Palatte in Odoo 18.1 Spreadsheet - Odoo Slides
Celine George
 
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
Applications of matrices In Real Life_20250724_091307_0000.pptx
gehlotkrish03
 
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
Care of patients with elImination deviation.pptx
AneetaSharma15
 
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 
Module 2: Public Health History [Tutorial Slides]
JonathanHallett4
 
pgdei-UNIT -V Neurological Disorders & developmental disabilities
JELLA VISHNU DURGA PRASAD
 
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
Virat Kohli- the Pride of Indian cricket
kushpar147
 
Continental Accounting in Odoo 18 - Odoo Slides
Celine George
 
INTESTINALPARASITES OR WORM INFESTATIONS.pptx
PRADEEP ABOTHU
 
How to Track Skills & Contracts Using Odoo 18 Employee
Celine George
 
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
Command Palatte in Odoo 18.1 Spreadsheet - Odoo Slides
Celine George
 

Perl

  • 1. Introduction To PERL Language Abhishek Pachisia B.Tech-IT (4th yr)
  • 2. FOREWORD  Original name Pearl.  Perl is a high-level, general-purpose, interpreted, dynamic programming language.  Perl is a programming language suitable for writing simple scripts as well as complex applications.  Perl is not officially an acronym.  Perl was originally developed by Larry Wall in 1987 as a general-purpose Unix scripting language  According to Wall, Perl has two slogans.  "There's more than one way to do it“.  "Easy things should be easy and hard things should be possible"
  • 3. BRIEF HISTORY  PERL 1 - Released on December 18, 1987.  PERL 2 - Released in 1988. Better regular expression engine.  PERL 3 - Released in 1989. Support for binary data streams.  PERL 4 - Released in 1991. To identify the version.  Programming Perl -1991. Known as Camel Book.  PERL 4.036 – Released in 1993.  CPAN – 26 October, 1995.
  • 4. VERSIONS OF PERL 5  PERL 5 porters – Released on May,1994.  PERL 5.000 - October 17,1994. Rewrite of the interpreter + Many new features.  PERL 5.001 - March 13,1995.  PERL 5.002 - February 29,1996. New prototypes feature  PERL 5.003 - June 25,1996. Security release.  PERL 5.004 - May 15,1997.Included UNIVERSAL package  PERL 5.005 - July 22,1998.Regex engine  PERL 5.6 – March 22,2000. 64-bit support, Unicode string representation etc.
  • 5. SYMBOLS  Dromedary Camel  Non-Commercial.  Onion  Licenses to its subsidiaries.
  • 6. FEATURES  The overall structure of Perl derives broadly from C.  Perl also takes features from shell programming.  All variables are marked with leading sigils.  It has many built-in functions.  Perl takes  Lists from Lisp,  Hashes ("associative arrays") from AWK, and  Regular expressions from sed.
  • 7. FEATURES THAT EASE TASK OF PROGRAMMER  Automatic memory management,  Dynamic typing,  Strings,  Lists, and hashes,  Regular expressions,  Introspection and  An eval() function.
  • 8. DESIGN - 1  Response to three broad trends in the computer industry –  Falling hardware costs,  Rising labour costs, and  Improvements in compiler technology.  Make efficient use of expensive computer- programmers.  No built-in limits similar to the Zero One Infinity rule.  Syntax reflects the idea that "things that are different should look different”
  • 9. DESIGN - 2  Perl favours language constructs that are concise and natural for humans to write.  Perl does not enforce any particular programming paradigm.  Not a tidy language. Resolve syntactical ambiguities.  No written specification/standard through Perl 5  That interpreter, together with its functional tests, stands as a de facto specification of the language.
  • 10. IMPLEMENTATION - 1  Implemented as a core interpreter, written in C.  The interpreter is 150,000 lines of C code and compiles to a 1 MB executable on typical machine architectures.  The interpreter has an object-oriented architecture.  All of the elements are represented in the interpreter by C structs.  The life of a Perl interpreter divides broadly into a compile phase and a run phase.  In compile phase , Compilation occurs.  In run phase, Execution occurs.
  • 11. IMPLEMENTATION-2  At compile time, the interpreter parses Perl code into a syntax tree.  At run time, it executes the program by walking the tree.  Text is parsed only once, and the syntax tree is subject to optimization before it is executed.  It is often said that “Only Perl can parse Perl”.  Perl makes the unusual choice of giving the user access to its full programming power in its own compile phase.  The cost in terms of theoretical purity is high, but practical inconvenience seems to be rare.
  • 12. CPAN  Comprehensive Perl Archive Network.  An archive of over 114,000 modules of software written in Perl, as well as documentation for it.  CPAN can denote  Archive network itself, or  The Perl program that acts as an interface to the network and as an automated software installer  Most software on CPAN is free and open source software.  Components:  Mirrors  Search engines  Testers  CPAN.pm and CPANPLUS
  • 13. COMPLEX PERL PROGRAM #!/usr/bin/perl use strict; use warnings; use Time::HiRes qw(sleep time); use POSIX qw(); use IO::Handle; my $delay = shift(@ARGV); STDOUT->autoflush(1); { my $start = time(); my $end = $start + $delay;
  • 14. my $last_printed; while ((my $t = time()) < $end) { my $new_to_print = POSIX::floor($end - $t); if (!defined($last_printed) or $new_to_print != $last_printed) { $last_printed = $new_to_print; print "Remaining $new_to_print/$delay", ' ' x 40, "r"; } sleep(0.1); } } print "n";