Interview :: Perl
What is Perl?
Perl stands for Practical Extraction and Reporting Language. It is a high-level programming language written by Larry Wall, specially designed for processing text. It supports object-oriented programming, and its syntax is quite similar to C language. It is much more flexible to use. Due to its strong text processing abilities, it has become one of the most popular languages for writing CGI scripts.
Perl is said to be both compiler and interpreter. It reads the source code, converts the program into bytecode before execution and then runs it. Hence, Perl is sometimes called an interpreter/compiler.
The operator used for the concatenation of strings is (.) operator.
CPAN stands for Comprehensive Perl Archive Network. It is a repository which contains thousands of Perl modules.
What are the features of Perl language?
The feature of Perl:
- It has a very simple Object-oriented programming syntax.
- It is easily extendible as it supports 25,000 open source modules.
- It supports Unicode.
- Includes powerful tools to process text to make it compatible with markup 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 can transform any text.
Perl advantages:
Perl disadvantages
The Perl print() function prints anything it gets as its argument.
The Perl say() function is not supported by older Perl versions. It is like Perl print() function with only one difference that it automatically adds a new line at the end.
Define dynamic scoping?
The assignment of temporary values to the global variables is called as dynamic scoping.
Explain lexical variables?
The variables which are created by the use of 'my' operator and private in nature are called as lexical variables.