Perl Michael U. Ang
Dec 31, 2015
PerlMichael U. Ang
History of Perl
• Perl was introduced in 1987• reason for its creation was that Mr. Wall was unhappy
by the functionality that sed, C, awk and the Bourne Shell offered him. He looked for a language that will combine all of their best features, while having as
few disadvantages
of its own.
Cont… A brief history of Perl
• Perl became especially popular as a language for writing server-side scripts for web-servers.
• But that's not the only use of perl, as it is commonly used for system administration tasks, managing database data, as well as writing GUI applications.
Perl Influences
• written by Larry Wall• A GNU product FREE, Open
Source software• Interpreted and not compiled!• 1º used as a scripting language• originally designed for UNIX®, but is
portable to other O/S• stable, cross platform programming
language
Introduction
What does Perl stand for?
• ‘Perl’ isn’t really an acronym• 2 favorite expansion:
-- Practical Extraction Report Language-- Pathologically Eclectic Rubbish Lister
• It's not PERL or P.E.R.L. • 'Perl' refers to the language• 'perl' to the interpreter that runs the programs
written in Perl
Perl Mantras
• Make easy things easy; make difficult things possible.
• TIMTOWTDI: There is more than one way to do it.
• DWIM: Do What I Mean
Versions
Version Descriptions Year
Perl 0 was never introduced to the public. Larry Wall only distributed this copy to his “officemates”.
---
Perl 1 released on to usenet's alt.comp.sources on Dec 18, 1987
1987
Perl 2 expanded the regular expression support (Perl 2 introduced Henry Spencer's regular expression package)
1988
Perl 3 introduced the ability to handle binary data (embedded nulls)
1989
Cont… Versions
Version Descriptions Year
Perl 4 introduced the first Camel book.
final Perl4 release, 4.036 in 1993
1991
Perl 5 drastic changes in syntax has been made; backward compatible;
it makes a lot of the old code obsolete.
introduced such things as hard references, modules, objects and lexical scoping
[in other words: introduced everything else, including the ability to introduce everything else]
most up-to-date stable version is 5.8
1994 /
1995
Perl 6 works in the way for (coming soon) Perl will include many new features not found in perl version 5
---
Version Descriptions Year
Cont… Versions
Perl Features
• Perl takes the best features from other languages, such as C, awk, sed, sh, and BASIC, among others.
• Perls database integration interface (DBI) supports third-party databases including Oracle, MySQL and others.
• works with HTML, XML, and other mark-up languages.
Cont… Perl Features
• supports Unicode. • supports both procedural and OO programming. • extensible. • The Perl interpreter can be embedded into other
systems.
Perl & the Web
• Perl is the most popular web programming language due to its text manipulation capabilities and rapid development cycle.
• Perl is widely known as "the duct-tape of the Internet".
• Perl's CGI.pm module, part of Perl's standard distribution, makes handling HTML forms simple.
• Perl can handle encrypted Web data, including e-commerce transactions.
Cont… Perl and the Web
• Perl can be embedded into web servers to speed up processing by as much as 2000%.
• mod_perl allows the Apache web server to embed a Perl interpreter.
• Perl's DBI package makes web-database integration easy.
Sample Programs
• Perl is interpreted, so no compilation is needed. To use Perl, create a text file that contains the Perl program. It is recommended that you end the filenames of your Perl scripts with ".pl" in order to distinguish them as Perl scripts.
• After you are done, invoke the Perl interpreter with the name of the file you created. Assuming your file is name "myscript.pl", you should type:
The Perl development cycle
# perl myscript.pl
Hello World
Note: Sample programs where made using OpenPerl IDE
• print -- echo strings and expressions to the screen.
• The "Hello World" program can be written in perl as follows:
• The string is enclosed in double-quotes(" ... ") bec that's how string constants are represented in perl.
• The semi-colon at the end indicates that this is the end of a perl command. Every perl command should be terminated with a semicolon.
The "Hello World" program
print "Hello World";
Another Example
Applications written in Perl
Amazon Online Auctions
• allowed for close of auctions and customer feedback
PayPal Shopping Cart Program
• is a CGI program written in Perl 5 and Javascript. • was designed to work directly with PayPal.
Yahoo
X-Forum bulletin board • is a free bulletin board, written in Perl. • Features: guests posting limitations, reply e-mail
notification for members, and many moderating tools.
Wemail
• a Web-based email program written in Perl. • It checks POP and IMAP and sends via sendmail or
SMTP. • features: custom folders, address book, attachments,
html email, filters, sorting, search, message labeling and more. It requres only CGI.pm.
Url’s and Books
• http://www.perl.com/-- the mother of all Perl sites (according to the site)
• www.cpan.org or http://www.perl.com/CPAN/
-- CPAN is the Comprehensive Perl Archive Network, a large collection of Perl software, modules and documentation
-- mirrors: http://www.cpan.org/SITES.html and http://mirror.cpan.org/.
• Note that CPAN is also the name of a Perl module, CPAN.pm, which is used to download and install Perl software from the CPAN archive.
• http://www.pm.org/
-- a loose association of international Perl User Groups.
• http://www.perldoc.com/
-- Perldoc.com
• http://www.perl.org/
Perl.org
• http://www.perlmonks.com/
-- Perl Monks
• http://use.perl.org/
-- Perl News
OpenPerl IDE(integrated development environment)
-- an IDE for writing and debugging Perl scripts with any standard Perl distribution under Win95/98/NT/2000/XP.
-- written in Delphi 5 Object Pascal and Perl and it is OpenSource
• http://open-perl-ide.sourceforge.net/
Perl Ports (Binary Distributions)• http://www.cpan.org/ports/index.html
-- contains listing of available Perl distribution codes for almost all types of operating systems.
Perl Mailing lists• http://lists.cpan.org/
Perl FAQ• http://perlfaq.cpan.org/
Books
• Programming Perl by Larry Wall, Tom Christiansen, Jon Orwant (O'Reilly July 2000)
• Learning Perl byRandal L. Schwartz, Tom Phoenix (O'Reilly, July 2001)
Cont… Books
• PERL How to Program by Deitel and Deitel et.al. (Prentice Hall, February 2001)
• Perl by Example by Ellie Quigley (Prentice Hall PTR, September 2001)
Cont… Books
• Professional Perl Development by Wainwright et.al. (Wrox Press, April 2001)
• Professional Perl Programming by Wainwright et.al. (Wrox Press, February 2001)
Perl Purity Test
• http://www.cpan.org/misc/perl.purity.test
-- Just for fun.