Case Study
Case Study
CASE STUDY
By
Yaswanth Sai Velagapudi 121710305055 - 3B5
Sudheer Paul Vindula 121710305056 - 3B5
Perl Compiler
Introduction:
Perl is a programming language which was
originally developed for script manipulation. But
now Perl is used for a variety of purpose including
web development, GUI development, system
administration and many more. It is a stable, cross
platform programming language.
For web development, Perl CGI is used. CGI is the
gateway which interacts with the web browser and
Perl in a system.
Its typical use is extracting information from a text
file and printing out report for converting a text
file into another form. This is because it got its
name after the expression, "Practical Extraction
and Report Language".
Programs written in Perl are called Perl scripts,
whereas system programs to execute Perl scripts
are called Perl program.
Perl is an interpreted language. When a Perl
program run, it is first compiled into a byte code,
then it is converted into machine instructions. So
writing something in Perl instead of C saves your
time.
It supports most of the operating systems and is
listed in Oxford English dictionary. Its concepts
and syntax is taken from many languages like awk,
bourne shell, C, sed and even English.
History:
It was first released with version 1.0 on December
18, 1987.
Perl was developed by Larry Wall in 1987 as a
scripting language to make report processing
easier.
Perl 2, released in 1988 adding a much better
regular expression engine.
Perl 3, released in 1989 adding support for binary
data streams.
Perl 4, released in 1991 with a better
documentation than earlier.
Perl 5, released on October 17, 1994. It added
many new features to its last version like objects,
variables, references and modules.
The latest version 5.24 is released on May 9, 2016.
Perl Licensing:
Perl 5 is copyright (C) 1993-2005, by Larry
Wall. It is open-source and free software. It can
be redistributed or modified under certain terms
and conditions of GNU and Artistic License.
he GNU General Public License provides a free
and open source software to its users.
Perl Features:
It has a very simple Object-oriented programming
syntax.
It is easily extendible as it supports 25,000 open
source modules.
It supports Unicode.
It includes powerful tools to process text to make it
compatible with mark-up languages like HTML,
XML.
It supports third party database including Oracle,
MySQL and many others.
It is embeddable in other systems such as web
servers and database servers.
It is open source software licensed under GNU.
Many frameworks are written in Perl.
It can handle encrypted web data including e-
commerce transactions.
It is a cross platform language.
It offers a regular expression engine which is able
Perl Installation:
Step 1
Check whether perl is already installed or not on your
system. In most of the cases, it is already installed in
your system.
In the CLI(Command Line Interface), pass the
following command
If perl is installed in your system, you’ll get the
message as shown in the snapshot. If not, then install as
shown in the following steps.
Step 2
Go to the following site of Perl,
http://padre.perlide.org/
Step 3
Click on download icon on top right.
Step 4
Choose your operating system
Step 5
Choose the version which you want to install.
Step 6
You have downloaded perl in your system. Now you
need to install it.
Step 7
Follow the instructions and install perl on your system.
Step 8
It shows the location where your perl is getting
installed. You can change it if you want.
Step 9
After installation again run first command to check
whether perl is installed or not. You’ll see the image as
shown in the step 1
Step 10
Install perl modules by running following commands.
Step 11
Open the perl application in your system.
Step 12
You have successfully installed perl in your system.
You are ready to build your applications on the perl.
Code:
#!/usr/bin/perl
use strict;
use warnings;
use IO::Handle;
my ( $remaining, $total );
STDOUT->autoflush(1);
while ( $remaining ) {
printf ( "Remaining %s/%s \r", $remaining--, $total );
sleep 1;
}
print "\n";
Running Perl
The following are the different ways to start Perl.
Interactive Interpreter
You can enter perl and start coding right away in the
interactive interpreter by starting it from the command
line. You can do this from Unix, DOS, or any other
system, which provides you a command-line interpreter
or shell window.
$perl -e <perl code> # Unix/Linux
or
or
Applications:
Perl has many and varied applications,
compounded by the availability of many standard
and third-party modules.
Perl has chiefly been used to write CGI scripts:
large projects written in Perl
include cPanel, Slash, Bugzilla, RT, TWiki,
and Movable Type; high-traffic websites that use
Perl extensively include Priceline.com, Craigslist,
[73]
IMDb,[74] LiveJournal, DuckDuckGo,[75][76] Slash
dot and Ticketmaster. It is also an optional
component of the popular LAMP technology stack
for Web development, in lieu of PHP or Python.
Perl is used extensively as a system programming
language in the Debian GNU/Linux distribution.[77]
Perl is often used as a glue language
Implementation:
Perl is implemented as a core interpreter, written in
C, together with a large collection of modules,
written in Perl and C. As of 2010, the interpreter is
150,000 lines of C code and compiles to a 1 MB
executable on typical machine architectures.
Alternatively, the interpreter can be compiled to a
link library and embedded in other programs. There
are nearly 500 modules in the distribution,
comprising 200,000 lines of Perl and an additional
350,000 lines of C code (much of the C code in the
modules consists of character encoding tables).
Advantages of PERL over C
1) Perl runs on all platforms and is far more portable
than C.
2) Perl and a huge collection of Perl Modules are free
software (either GNU General Public License or
Artistic License).
3) Perl is very much efficient in TEXT and STRING
manipulation i.e. REG_EXP.
4) It is a language that combines the best features from
many other languages and is very easy to learn if you
approach it properly.
5) Dynamic memory allocation is very easy in PERL, at
any point of time we can increase or decrease the size
of the array.
Disadvantages of PERL over C
1) You cannot easily create a binary image ("exe") from
a Perl file. It's not a serious problem on Unix, but it
might be a problem on Windows.
2) Moreover, if you write a script which uses modules
from CPAN, and want to run it on another computer,
you need to install all the modules on that other
computer, which can be a drag.
3) Perl is an interpretative language, so its
comparatively slower to other
compiling language like C. So, it s not feasible to use in
Real time environment like in flight simulation system.
References:
1. "Perl 5.30.3 is now available!".
www.nntp.perl.org. Retrieved June 2, 2020.
2.^ "Perl 5.28.3 is now available!".
www.nntp.perl.org. Retrieved June 2, 2020.
3.^ "Perl 5.32.0-RC1 is now available!". perl.org.
June 7, 2020. Retrieved June 9, 2020.
4.^ Jump up to:a b "The "Artistic License" -
dev.perl.org". dev.perl.org.
5.^ Jump up to:a b Artistic - file on the Perl 5 git
repository
6.^ Jump up to:a b "Perl Licensing". dev.perl.org.
Retrieved January 8, 2011.
7.^ Larry Wall. "Programming is Hard, Let's Go
Scripting..." All language designers have their
occasional idiosyncracies. I’m just better at it than
most.
8.^ "About Perl". perl.org. Retrieved April
20, 2013. "Perl" is a family of languages, "Perl 6"
is part of the family, but it is a separate language
that has its own development team. Its existence
has no significant impact on the continuing
development of "Perl 5".
9.^ "Path to raku by lizmat". github.com.
Retrieved October 16, 2019. This document
describes the steps to be taken to effectuate a
rename of `Perl 6` to `Raku`, as described in issue
#81.
10. ^ Lapworth, Leo. "General Questions About
Perl". Perl FAQ. Perl.org. Retrieved February
24, 2012.
11. ^ "perl(1): Practical Extraction/Report
Language - Linux man page". Linux.die.net.
Retrieved July 23, 2013.