Perl Scripts - Resources for CGI and Perl Programming
Perl, also Practical Extraction and Report Language (a backronym, see below) is a dynamic procedural programming language designed by Larry Wall and first released in 1987. Perl borrows features from C, shell scripting (sh), awk, sed, Lisp, and, to a lesser extent, many other programming languages.
The language is intended to be practical (easy to use, efficient, complete) rather than beautiful (tiny, elegant, minimal). Its major features are that it's easy to use, supports both procedural and object-oriented (OO) programming, has powerful built-in support for text processing, and has a large collection of third-party modules.
The overall structure of Perl derives broadly from the programming language C. Perl is a procedural programming language, with variables, expressions, assignment statements, brace-delimited code blocks, control structures, and subroutines.
Perl also takes features from shell programming. All variables are marked with leading sigils. Sigils unambiguously identify variable names, allowing Perl to have a rich syntax. Importantly, sigils allow variables to be interpolated directly into strings. Like the Unix shells, Perl has many built-in functions for common tasks, like sorting, and for accessing system facilities. Perl takes lists from Lisp, associative arrays from awk, and regular expressions from sed. These simplify and facilitate all manner of parsing, text handling, and data management tasks.
In Perl 5, features were added that support complex data structures, first-class functions (i.e. closures as values), and an object-oriented programming model. These include references, packages, and class-based method dispatch. Perl 5 also saw the introduction of lexically scoped variables, which make it easier to write robust code, and modules, which make it practical to write and distribute libraries of Perl code.
All versions of Perl do automatic data typing and memory management. The interpreter knows the type and storage requirements of every data object in the program; it allocates and frees storage for them as necessary. Legal type conversions are done automatically at run time; illegal type conversions are fatal errors.
Perl has many and varied applications. It has been used since the early days of the Web to write CGI scripts, and is an integral component of the popular LAMP (Linux / Apache / MySQL / Perl, PHP, and Python) platform for web development. Large projects written in Perl include Slash, early implementations of PHP, and UseModWiki, the wiki software used in Wikipedia until 2002. It's known as one of "the three Ps" (Perl, Python, and PHP), which are the most popular server-side, open source scripting languages for the Web, though open source Java and C# implementations as well as Ruby have grown popular in recent years.
Perl is often used as a "glue language", tying together systems and interfaces that were not specifically designed to interoperate. Systems administrators use Perl as an all-purpose tool; short Perl programs can be entered and run on a single command line. Perl is widely used in finance and bioinformatics, where it is valued for rapid application development, ability to handle large data sets, and the availability of many standard and third-party modules.
Perl is implemented as a core interpreter, written in C, together with a large collection of modules, written in Perl and C. The source distribution is, as of 2005, 12 MB when packaged in a tar file and compressed. 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.
The interpreter has an object-oriented architecture. All of the elements of the Perl languagescalars, arrays, hashes, coderefs, file handlesare represented in the interpreter by C structs. Operations on these structs are defined by a large collection of macros, typedefs and functions; these constitute the Perl C API. The Perl API can be bewildering to the uninitiated, but its entry points follow a consistent naming scheme, which provides guidance to those who use it.
The execution of a Perl program divides broadly into two phases: compile-time and run-time. At compile time, the interpreter parses the program text into a syntax tree. At run time, it executes the program by walking the tree. The text is parsed only once, and the syntax tree is subject to optimization before it is executed, so the execution phase is relatively efficient. Compile-time optimizations on the syntax tree include constant folding, context propagation, and peephole optimization.
Perl is a dynamic language and has a context-sensitive grammar that cannot be parsed by a straight Lex/Yacc lexer/parser combination. Instead, it implements its own lexer, which coordinates with a modified GNU bison parser to resolve ambiguities in the language. It is said that "only perl can parse Perl", meaning that only the Perl interpreter (perl) can parse the Perl language (Perl). The truth of this is attested to by the persistent imperfections of other programs that undertake to parse Perl, such as source code analyzers and auto-indenters.
Maintenance of the Perl interpreter has become increasingly difficult over the years. The code base has been in continuous development since 1994. The code has been optimized for performance at the expense of simplicity, clarity, and strong internal interfaces. New features have been added, yet virtually complete backward compatibility with earlier versions is maintained. The size and complexity of the interpreter is a barrier to developers who wish to work on it.
Perl is distributed with some 90,000 functional tests. These run as part of the normal build process, and extensively exercise the interpreter and its core modules. Perl developers rely on the functional tests to ensure that changes to the interpreter do not introduce bugs; conversely, Perl users who see the interpreter pass its functional tests on their system can have a high degree of confidence that it is working properly.
There is no written specification or standard for the Perl language, and no plans to create one for the current version of Perl. There has only ever been one implementation of the interpreter. That interpreter, together with its functional tests, stands as a de facto specification of the language.
Perl is free software, and is licensed under both the Artistic License and the GNU General Public License. It is available for most operating systems. It is particularly prevalent on Unix and Unix-like systems (such as Linux, FreeBSD, and Mac OS X), and is growing in popularity on Microsoft Windows systems.
Perl has been ported to over a hundred different platforms, and can, with only six reported exceptions, be compiled from source on all Unix-like, POSIX-compliant or otherwise Unix-compatible platforms, including AmigaOS, BeOS, Cygwin, and Mac OS X (See ports). A special port, MacPerl, is available for Mac OS Classic.
Perl can be compiled from source on Windows, however many Windows installations lack a C compiler, so Windows users typically install a binary distribution, such as ActivePerl or IndigoPerl. Users without a C compiler are also limited to pure Perl modules if they wish to add to the module library that comes with Perl. There's free software that can enable these users to install C modules, however it tends to be poorly documented, especially for beginners.
These links have been provided for informational purposes only. We have not evaluated them. Hinduwebsite.com does not have any relationship with them. Some of the links may be outdated as they have not been recently updated.
Suggestions for Further Reading
- Common Gateway Interface - CGI
- CRM, Customer Relationship Management
- Data Warehouse and Data Mining Technologies
- Relational Databases
- DHTML Scripts - Resources For Dynamic Websites
- Domain Name Registration Services
- Ecommerce and Online Store Solutions
- Online Marketing Solutions and Promotions
- Essays on Information Technology
- Free Software, Tools and Applications
- Computer and Web Graphics
- HyperText Markup Language
- Html Tools for World Wide Web
- Java Programming language, Tutorials, Tools and Applets
- Computer Networks
- Computer Operating Systems
- OS X Mountain Lion and Parallels Desktop For Mac
- Perl Scripts - Resources for CGI and Perl Programming
- Programming Languages
- Project Management
- Search Engines and SEO
- Web design and Website development
- Best Web Hosting Services
- Web Resources and Web Tools
- Web Tools And Web Resources For The Web Masters
- Essays On Dharma
- Esoteric Mystic Hinduism
- Introduction to Hinduism
- Hindu Way of Life
- Essays On Karma
- Hindu Rites and Rituals
- The Origin of The Sanskrit Language
- Symbolism in Hinduism
- Essays on The Upanishads
- Concepts of Hinduism
- Essays on Atman
- Hindu Festivals
- Spiritual Practice
- Right Living
- Yoga of Sorrow
- Mental Health
- Concepts of Buddhism
- General Essays
Attribution: Some information for this article has been adapted from wikipedia under Creative Commons Attribution-ShareAlike License.
Disclaimer: The external links provided herein are third-party links. We do not have any control over them and we cannot guarantee their accuracy or their authenticity. The links are being provided as a convenience and for informational purposes only; they do not constitute an endorsement or an approval by Hinduwebsite.com of any of the products, services or opinions of the corporation or organization or individual. Hinduwebsite.com bears no responsibility for the accuracy, legality or content of the external site or for that of subsequent links. Any transactions that you enter into with a vendor, merchant or other party listed in this site or linked from this site are solely between you and that vendor, merchant or other party. Contact the external site for answers to questions regarding its content.
Translate the Page