SlideShare una empresa de Scribd logo
1 de 15
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

Más contenido relacionado

La actualidad más candente

Lecture 1 Compiler design , computation
Lecture 1 Compiler design , computation Lecture 1 Compiler design , computation
Lecture 1 Compiler design , computation Rebaz Najeeb
 
Ecet 330 Enthusiastic Study / snaptutorial.com
Ecet 330 Enthusiastic Study / snaptutorial.comEcet 330 Enthusiastic Study / snaptutorial.com
Ecet 330 Enthusiastic Study / snaptutorial.comStephenson033
 
Implementation - Sample Runs
Implementation - Sample RunsImplementation - Sample Runs
Implementation - Sample RunsAdwiteeya Agrawal
 
How to use Ruby code inside Elixir
How to use Ruby code inside ElixirHow to use Ruby code inside Elixir
How to use Ruby code inside ElixirWeverton Timoteo
 
Firebird Python Drivers: Current state and future
 Firebird Python Drivers: Current state and future Firebird Python Drivers: Current state and future
Firebird Python Drivers: Current state and futureMind The Firebird
 

La actualidad más candente (8)

Lecture 1 Compiler design , computation
Lecture 1 Compiler design , computation Lecture 1 Compiler design , computation
Lecture 1 Compiler design , computation
 
Ecet 330 Enthusiastic Study / snaptutorial.com
Ecet 330 Enthusiastic Study / snaptutorial.comEcet 330 Enthusiastic Study / snaptutorial.com
Ecet 330 Enthusiastic Study / snaptutorial.com
 
Design
DesignDesign
Design
 
Implementation - Sample Runs
Implementation - Sample RunsImplementation - Sample Runs
Implementation - Sample Runs
 
OIVM
OIVMOIVM
OIVM
 
MPI - 1
MPI - 1MPI - 1
MPI - 1
 
How to use Ruby code inside Elixir
How to use Ruby code inside ElixirHow to use Ruby code inside Elixir
How to use Ruby code inside Elixir
 
Firebird Python Drivers: Current state and future
 Firebird Python Drivers: Current state and future Firebird Python Drivers: Current state and future
Firebird Python Drivers: Current state and future
 

Destacado (20)

Top Management of 5 recognized comapanies
Top Management of 5 recognized comapaniesTop Management of 5 recognized comapanies
Top Management of 5 recognized comapanies
 
Tree
TreeTree
Tree
 
Rpc
RpcRpc
Rpc
 
Boeing- The Frontiers
Boeing- The FrontiersBoeing- The Frontiers
Boeing- The Frontiers
 
Cloud Service Models
Cloud Service ModelsCloud Service Models
Cloud Service Models
 
Fourier transform
Fourier transformFourier transform
Fourier transform
 
File System Implementation
File System ImplementationFile System Implementation
File System Implementation
 
Rms titanic
Rms titanicRms titanic
Rms titanic
 
Telecom Industry
Telecom IndustryTelecom Industry
Telecom Industry
 
V.G. siddhartha
V.G. siddharthaV.G. siddhartha
V.G. siddhartha
 
Strategic alignment model (SAM)
Strategic alignment model (SAM)Strategic alignment model (SAM)
Strategic alignment model (SAM)
 
Vb.net (loop structure)
Vb.net (loop structure)Vb.net (loop structure)
Vb.net (loop structure)
 
Matrix Representation Of Graph
Matrix Representation Of GraphMatrix Representation Of Graph
Matrix Representation Of Graph
 
Hydrogen energy
Hydrogen energyHydrogen energy
Hydrogen energy
 
Inference engine
Inference engineInference engine
Inference engine
 
Exception handling in Java
Exception handling in JavaException handling in Java
Exception handling in Java
 
Work breakdown structure
Work breakdown structureWork breakdown structure
Work breakdown structure
 
IEEE 802.11
IEEE 802.11IEEE 802.11
IEEE 802.11
 
Expert Systems
Expert SystemsExpert Systems
Expert Systems
 
Program Evaluation and Review Technique (PERT)
Program Evaluation and Review Technique (PERT)Program Evaluation and Review Technique (PERT)
Program Evaluation and Review Technique (PERT)
 

Similar a Perl

WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTHWEB PROGRAMMING UNIT V BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTHBhavsingh Maloth
 
Future of PERL in IT
Future of PERL in ITFuture of PERL in IT
Future of PERL in ITNexiilabs
 
Mastering Regex in Perl
Mastering Regex in PerlMastering Regex in Perl
Mastering Regex in PerlEdureka!
 
Keeping up with Perl: Development, Upgrade and Deployment Options for Perl 5.12
Keeping up with Perl: Development, Upgrade and Deployment Options for Perl 5.12Keeping up with Perl: Development, Upgrade and Deployment Options for Perl 5.12
Keeping up with Perl: Development, Upgrade and Deployment Options for Perl 5.12ActiveState
 
Unit 1-introduction to perl
Unit 1-introduction to perlUnit 1-introduction to perl
Unit 1-introduction to perlsana mateen
 
Introduction to perl
Introduction to perlIntroduction to perl
Introduction to perlsana mateen
 
introductiontoperl-springpeople-150605065831-lva1-app6891.pptx
introductiontoperl-springpeople-150605065831-lva1-app6891.pptxintroductiontoperl-springpeople-150605065831-lva1-app6891.pptx
introductiontoperl-springpeople-150605065831-lva1-app6891.pptxmayilcebrayilov15
 
Perl family: 15 years of Perl 6 and Perl 5
Perl family: 15 years of Perl 6 and Perl 5Perl family: 15 years of Perl 6 and Perl 5
Perl family: 15 years of Perl 6 and Perl 5Michal Jurosz
 
Introduction to perl_ a scripting language
Introduction to perl_ a scripting languageIntroduction to perl_ a scripting language
Introduction to perl_ a scripting languageVamshi Santhapuri
 
Introduction To Perl - SpringPeople
Introduction To Perl - SpringPeopleIntroduction To Perl - SpringPeople
Introduction To Perl - SpringPeopleSpringPeople
 
Unit1 principle of programming language
Unit1 principle of programming languageUnit1 principle of programming language
Unit1 principle of programming languageVasavi College of Engg
 
introduction to Perl _ the programming language.pptx
introduction to Perl _ the programming language.pptxintroduction to Perl _ the programming language.pptx
introduction to Perl _ the programming language.pptxgayathriaddula502
 

Similar a Perl (20)

Perl
PerlPerl
Perl
 
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTHWEB PROGRAMMING UNIT V BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTH
 
Group1_PERL.pptx
Group1_PERL.pptxGroup1_PERL.pptx
Group1_PERL.pptx
 
Future of PERL in IT
Future of PERL in ITFuture of PERL in IT
Future of PERL in IT
 
Mastering Regex in Perl
Mastering Regex in PerlMastering Regex in Perl
Mastering Regex in Perl
 
Keeping up with Perl: Development, Upgrade and Deployment Options for Perl 5.12
Keeping up with Perl: Development, Upgrade and Deployment Options for Perl 5.12Keeping up with Perl: Development, Upgrade and Deployment Options for Perl 5.12
Keeping up with Perl: Development, Upgrade and Deployment Options for Perl 5.12
 
Perl Reference.ppt
Perl Reference.pptPerl Reference.ppt
Perl Reference.ppt
 
Unit 1-introduction to perl
Unit 1-introduction to perlUnit 1-introduction to perl
Unit 1-introduction to perl
 
Introduction to Perl
Introduction to PerlIntroduction to Perl
Introduction to Perl
 
Introduction to perl
Introduction to perlIntroduction to perl
Introduction to perl
 
introductiontoperl-springpeople-150605065831-lva1-app6891.pptx
introductiontoperl-springpeople-150605065831-lva1-app6891.pptxintroductiontoperl-springpeople-150605065831-lva1-app6891.pptx
introductiontoperl-springpeople-150605065831-lva1-app6891.pptx
 
Perl family: 15 years of Perl 6 and Perl 5
Perl family: 15 years of Perl 6 and Perl 5Perl family: 15 years of Perl 6 and Perl 5
Perl family: 15 years of Perl 6 and Perl 5
 
Introduction to perl_ a scripting language
Introduction to perl_ a scripting languageIntroduction to perl_ a scripting language
Introduction to perl_ a scripting language
 
The Parrot VM
The Parrot VMThe Parrot VM
The Parrot VM
 
Introduction To Perl - SpringPeople
Introduction To Perl - SpringPeopleIntroduction To Perl - SpringPeople
Introduction To Perl - SpringPeople
 
Unit 1
Unit 1Unit 1
Unit 1
 
Intro
IntroIntro
Intro
 
Intro
IntroIntro
Intro
 
Unit1 principle of programming language
Unit1 principle of programming languageUnit1 principle of programming language
Unit1 principle of programming language
 
introduction to Perl _ the programming language.pptx
introduction to Perl _ the programming language.pptxintroduction to Perl _ the programming language.pptx
introduction to Perl _ the programming language.pptx
 

Último

Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 

Último (20)

Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 

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";