Outline of Perl

From HandWiki
Short description: Overview of and topical guide to Perl

The following outline is provided as an overview of and topical guide to the Perl programming language:

Perlhigh-level, general-purpose, interpreted, multi-paradigm, dynamic programming language. Perl was originally developed by Larry Wall in 1987 as a general-purpose Unix scripting language to make report processing easier.[1] Since then, it has undergone many changes and revisions and become widely popular amongst programmers. Larry Wall continues to oversee development of Raku. Note that Perl and Raku are receiving ongoing development, therefore making Perl a family of programming languages. It stands for Practical Extraction and Reporting Language which processes data using pattern matching technique.

What type of thing is Perl?

  • Perl can be described as all of the following types of things:
    • Family of programming languages – a programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely. Both Perl and Raku are each considered a:
      • General-purpose programming language – programming language designed to be used for writing software in a wide variety of application domains.
      • High-level programming language – programming language with strong abstraction from the details of the computer. While low-level programming languages are very cryptic, a higher-level programming language may use natural language elements, be easier to use, making the process of developing a program simpler and more understandable with respect to a low-level language.
        • Interpreted language – programming language in which programs are 'indirectly' executed ("interpreted") by an interpreter program. This can be contrasted with a compiled language which is converted into machine code and then 'directly' executed by the host CPU.
          • Scripting language – programming language that supports the writing of scripts, programs written for a software environment that automate the execution of tasks which could alternatively be executed one by one by a human operator.
            • Glue language – programming language (usually a scripting language) used for writing programs or scripts that activate other scripts and programs (thus "gluing" them together).
          • Dynamic programming language – high-level programming language that executes many common behaviors while running that other languages might perform during compilation, if at all. These behaviors could include extension of the program, by adding new code, by extending objects and definitions, or by modifying the type system, all during program execution.
            • Dynamically typed programming language – A programming language is said to be dynamically typed when the majority of its type checking (for example numerical vs. non-numerical) is performed at run-time as opposed to at compile-time. Therefore, the type for a particular variable or value is not locked in. In dynamic typing values have types, but variables do not; that is, a variable can refer to a value of any type.
    • Free and open-source software – software that is both free software and open source. It is liberally licensed to grant users the right to use, copy, study, change, and improve its design through the availability of its source code.[2] Both Perl and Raku are free and open-source.
      • Free software – software that can be used, studied, and modified without restriction, and which can be copied and redistributed in modified or unmodified form either without restriction, or with restrictions that only ensure that further recipients have the same rights under which it was obtained and that manufacturers of consumer products incorporating free software provide the software as source code. In addition to this, Perl is available for free (i.e., at no cost).
      • Open-source software – computer software that is available in source code form: the source code and certain other rights normally reserved for copyright holders are provided under an open-source license that permits users to study, change, improve and at times also to distribute the software. Open source software is very often developed in a public, collaborative manner. Perl is developed and supported by a large international community of volunteers.

Other names for Perl

  • Backronyms that describe Perl while treating it as an acronym:
    • PERL = Practical Extraction and Report Language[3]
    • PERL = Pathologically Eclectic Rubbish Lister[4]
  • Other descriptions
    • Duct tape for the Internet[5]
    • Swiss Army chainsaw of scripting languages

Aspects of Perl

Strengths of Perl

  • Flexibility – perl is feature rich, and has borrowed from many other programming languages. This is reflected in the motto "There's more than one way to do it". There are also many extension modules available to expand the language.
  • Cross-platform implementation – perl programs work on many types of computers, usually without the need to modify the source code. Perl interpreters have been developed for most operating systems (platforms), taking into account the idiosyncrasies of each, so all such platforms can theoretically run the same code.
  • Text manipulation – anything from spell checking, to search and replace operations using regex, to natural language processing.
  • Database manipulation –
  • Shell scripting – perl is good for writing programs in the form of a series of commands to be run by the Unix shell, a command line interpreter. Such programs are called "scripts". In this regard, perl is considered to be a scripting language. Typical operations performed by shell scripts include program execution, printing text, and file manipulation (copying, renaming, deleting, etc.).
  • Being an interpreted language, perl has the following advantages:
    • Platform independence
    • Reflection and reflective use of the evaluator (e.g. a first-order eval function)
    • Smaller executable program size (since implementations have flexibility to choose the instruction code)
    • Dynamic typing
    • Dynamic scoping

Weaknesses of Perl

  • Slow – being an interpreted language, perl code generally runs slower than compiled code. It would not be well suited for writing state-of-the-art video games, for example.
  • Software maintenance – source code may be cryptic (much like C), making it difficult to maintain code or fix bugs in code written by somebody else, unless adequate remarks are included.

Components of Perl

Perl documentation

Perl language structure

Perl language structure

  • Perl data types – classifications identifying various types of data, that determine the possible values for each type; the operations that can be done on values of each type; the meaning of the data; and the way values of each type can be stored.[6][7] The main data types in perl are:
  • Perl control structures
  • Perl modules - modular extensions of the Perl language. The following modules (and module groups) and many more, including support for them (manuals, etc.) can be found on CPAN.org, using its search box:
    • Webpage-related modules – for creating, serving, fetching, and parsing web pages
      • CGI.pm
      • Library for WWW in Perl (LWP)
      • WebFetch
      • URI
      • HTML
    • Graphics-related modules – for manipulating graphics and images
      • GD
      • Graphics
      • Image
        • Image-Pngslimmer
    • CTPP
    • [[DBIx::Class|]]
    • Gtk2-Perl
    • Mason
    • Moose
    • Perl Data Language (PDL)
    • Perl DBI
    • Perl Object Environment
    • Template Toolkit
    • Tk – for building Perl programs with a graphical user interface

Elements of a perl script

  • #!usr/bin/perl – called the "shebang line", after the hash symbol (#) and ! (bang) at the beginning of the line. It is also known as the interpreter directive.
  • # – the number sign, also called the hash symbol. In Perl, the # indicates the start of a comment. It instructs perl to ignore the rest of the line and not execute it as script code.
  • Main structure (derived from C)

Programming tools

Text editors that support Perl scripting

  • Notepad++ – supports syntax highlighting and code folding for over 50 programming, scripting, and markup languages, including Perl.
  • gedit – free open source text editor for the GNOME desktop environment, Mac OS X and Microsoft Windows. Designed as a general purpose text editor, gedit emphasizes simplicity and ease of use. It includes tools for editing source code and structured text such as markup languages. It has configurable syntax highlighting for various languages including Perl.
  • UltraEdit – commercial text editor for Microsoft Windows, Linux and Mac OS X (Intel) created in 1994 by Ian D. Mead. The editor contains tools for programmers, including macros, configurable syntax highlighting, code folding, file type conversions, project management, Perl Compatible Regular Expressions for search-and-replace, a column-edit mode, remote editing of files via FTP, interfaces for APIs or command lines of choice and more.
  • Vim – free and open-source text editor based on vi, designed for use both from a command line interface and as a standalone application in a graphical user interface. Includes a scripting interface for Perl.
  • Visual Studio Code – is a free source-code editor from Microsoft, and available for Windows, Linux and macOS. Includes syntax highlighting for Perl and the ability to run and debug Perl code directly within the editor.

Perl support

  • CPAN – the Comprehensive Perl Archive Network, a repository of over 250,000 software modules and accompanying documentation for 39,000 distributions, written in the Perl programming language by over 12,000 contributors.

Websites

Publications about Perl

Books about Perl

  • Programming Perl (aka the Camel Book)
  • Learning Perl (aka the Llama Book[8])
  • Intermediate Perl
  • Mastering Perl by brian d foy
  • Advanced Perl Programming
  • Effective Perl Programming
  • Higher-Order Perl
  • Perl Best Practices
  • Perl Cookbook
  • Perl Design Patterns Book
  • Object Oriented Perl
  • Perl Hacks

Magazines about Perl

  • The Perl Review

History of Perl

Versions of Perl

Perl was derived from

  • AWK – interpreted programming language designed for text processing and typically used as a data extraction and reporting tool. It is a standard feature of most Unix-like operating systems. AWK is named using the initials from the last name of each of its 3 authors.
  • C – very popular programming language. Many later languages have borrowed directly or indirectly from C, including C++, D, Go, Rust, Java, JavaScript, Limbo, LPC, C#, Objective-C, Perl, PHP, Python, Verilog (hardware description language), and Unix's C shell. These languages have drawn many of their control structures and other basic features from C. Most of them (with Python being the most dramatic exception) are also very syntactically similar to C in general, and they tend to combine the recognizable expression and statement syntax of C with underlying type systems, data models, and semantics that can be radically different.
  • grep – grep stands for "Global Regular Expression Print". It is command-line utility for searching plain-text data sets for lines matching a regular expression. Grep was originally developed for the Unix operating system, but is available today for all Unix-like systems.
  • sed – (stream editor), is a Unix utility that parses and transforms text, using a simple, compact programming language. sed was one of the earliest tools to support regular expressions, and remains in use for text processing, most notably with the substitution command. Other options for doing "stream editing" include AWK and Perl.
  • sh – the Bourne shell, a command-line shell for Unix.

Perl software

Commercial software programmed in Perl

Free software programmed in Perl

  • Agora – was a World Wide Web email browser and was a proof of concept to help people to use the full internet. Agora was an email-based web browser designed for non-graphic terminals and to help people without full access to the internet such as in developing countries or without a permanent internet connection. Similar to W3Gate, Agora was a server application designed to fetch HTML documents through e-mail rather than http.
  • Automake – programming tool that produces portable makefiles for use by the make program, used in compiling software. It is made by the Free Software Foundation as one of GNU programs, and is part of the GNU build system. The makefiles produced follow the GNU Coding Standards.
  • AWStats – open source Web analytics reporting tool, suitable for analyzing data from Internet services such as web, streaming media, mail and FTP servers.
  • AxKit – was an XML Apache publishing framework run by the Apache foundation written in Perl. It provided on-the-fly conversion from XML to any format, such as HTML, WAP or text using either W3C standard techniques, or flexible custom code.
  • BackupPC – free Disk-to-disk backup software suite with a web-based frontend. The cross-platform server will run on any Linux, Solaris, or UNIX based server. No client is necessary.
  • Blosxom – free-software weblog program (and simple content management system) written in Perl by Rael Dornfest. It uses the pre-existing file system instead of a database management system, unlike most blog software.
  • Bricolage – Enterprise Class content management system (CMS) competitive in features and capability to high end, high cost proprietary products.
  • Bugzilla – Web-based general-purpose bugtracker and testing tool originally developed and used by the Mozilla project, and licensed under the Mozilla Public License.
  • Catalyst – open source web application framework. A web application developer would use Catalyst to deal with code common to all web applications: it provides interfaces to web servers and receiving page requests, dispatching these into developer-written code to process and return the requests, and provides a standardised interface for data models, authentication, session management and other common web application elements.
  • CGI – CGI program written in Perl that allows access to IRC via a web browser. It is designed to be flexible and has many uses such as an IRC gateway for an IRC network, a chat-room for a website or to access IRC when stuck behind a restrictive firewall.
  • ChipVault – terminal based Vi wrapper for creating and managing Verilog and VHDL RTL ( register transfer level ) based ASIC and FPGA digital chip designs. It was created by an ASIC designer in 2001 to improve his daily workflow.
  • Dada Mail – web-based electronic mailing list management system that can be used for announcement lists. It can also be used to create and manage discussion lists, if you activate and configure an included plug-in called Dada Bridge, for which you will need to set a cron task.
  • Dancer – open source micro web application framework written in Perl inspired by Ruby's Sinatra.
  • Debian bug tracking system – the bug tracking system used by the Debian project. Its unique feature is that it doesn't have any form of web-interface to edit bug reports - all modification is done through email.
  • DJabberd – open source XMPP application server.
  • Drakconf – allows easy configuration of Mandriva Linux, a Linux distribution.
  • EPrints – open source software package for building open access repositories that are compliant with the Open Archives Initiative Protocol for Metadata Harvesting. It shares many of the features commonly seen in Document Management systems, but is primarily used for institutional repositories and scientific journals.
  • Fink – project to port and package open-source Unix programs to Mac OS X.
  • Ganglia – scalable distributed system monitor tool for high-performance computing systems such as clusters and grids. It allows the user to remotely view live or historical statistics (such as CPU load averages or network utilization) for all machines that are being monitored.
  • Git – distributed revision control and source code management (SCM) system with an emphasis on speed.
  • GNU parallel – command-line driven utility for Linux or other Unix-like operating systems which allows the user to execute shell scripts in parallel. It is free software, available under the terms of GPLv3.
  • GPRename – program for renaming multiple files and directories at one time. It runs on any Unix-like operating system.
  • Ikiwiki – wiki application that stores its pages in a standard version control system such as Git or Subversion or 6+ others.
  • Infobot – IRC bot that remembers URLs and associate them with a descriptive name.
  • LiveJournal – free and open-source server software that also runs the LiveJournal virtual community.
  • LiVES – video editing software and VJ tool, released under the GNU General Public License version 3 or later with versions available for Linux distributions, BSD, Solaris, and IRIX.
  • Logitech Media Server – streaming audio server that supports Logitech's Squeezebox range of digital audio receivers.
  • Maypole framework – web application framework for Model-view-controller-oriented applications. It is designed to minimize coding requirements for creating simple web interfaces to databases, while remaining flexible enough to support enterprise web applications.
  • Mojolicious – real-time web application framework designed for use in both simple and complex web applications.
  • Movable Type – weblog publishing system that can host multiple weblogs and standalone content pages, manage files and user roles, templates, tags, categories, and trackback links.
  • Netpbm – open source package of graphics programs and programming library. Works under many Unix platforms, Windows, Mac OS X, VMS, and Amiga OS.
  • OCS Inventory – inventory a network's IT assets by collecting information about the hardware and software of networked machines running the OCS client program ("OCS Inventory Agent"). OCS can be used to visualize the inventory through a web interface.
  • Openkore – custom client and an advanced automated assistant for the MMORPG Ragnarok Online. Licensed under the GNU General Public License.
  • OTRS – Open-source Ticket Request System. Free and open-source trouble ticket system software package that a company, organization, or other entity can use to assign tickets to incoming queries and track further communications about them.
  • Padre – Perl Application Development and Refactoring Environment, a multi-language software development platform comprising an IDE and a plug-in system to extend it. For developing applications in Perl.
  • Perlbal – reverse proxy load balancer and web server. Distributed under both the GNU General Public License and the Artistic License.
  • Pisg – Perl IRC Statistics Generator, an open-source Internet Relay Chat (IRC) log file analysis and statistical visualization program that analyzes various formats of log files from IRC clients and bots and generates HTML pages containing statistics about the channel the logs were taken from.
  • Qpsmtpd – SMTP daemon written in Perl. It was originally designed to be a drop-in replacement for qmail-smtpd, the SMTP component of qmail, and it is now also compatible with Postfix, Exim, sendmail and virtually any software that "speaks SMTP".
  • Request Tracker – ticket-tracking system written in Perl used to coordinate tasks and manage requests among a community of users.
  • Satellite – Redhat Satellite is an open source system management system that allows a system's administrators to deploy, manage and monitor Redhat Linux and Solaris hosts. Basically a local version of Red Hat Network.
  • Scoop – content management system (CMS) for collaborative publishing geared toward encouraging user contributions and participation. The latest version released was 1.1.8 in 2007. It is no longer developed.
  • Spacewalk – open source systems management software developed by Red Hat. It is the upstream version of the RHN Satellite Server, which was open sourced in 2008. Spacewalk includes the web interface and back-end, as well as RHN Proxy Server and associated client software of Satellite and makes them available to users and developers under a free and open-source software (FOSS) license.
  • SpamAssassin – e-mail spam filter that uses content-matching rules, released under the Apache License 2.0. It is now part of the Apache Foundation.
  • SQL-Ledger – enterprise resource planning (ERP) and double entry accounting system. Accounting data is stored in an SQL Database Server and a standard web browser can be used as its user interface.
  • SVK – decentralized version control system, with a hierarchical distributed design comparable to centralized deployment of BitKeeper and GNU arch.
  • Template Toolkit – template engine used primarily for building web sites, but is also suitable for creating any type of digital document, such as a PDF or LaTeX file. Template Toolkit is based on a mini-language and does not allow direct Perl in its templates.
  • TWiki – structured wiki application, typically used to run a collaboration platform, knowledge or document management system, a knowledge base, or team portal. Users can create wiki applications using the TWiki Markup Language, and developers can extend its functionality with plugins.
  • UDPCast – file transfer tool that can send data simultaneously to many destinations on a LAN. This can for instance be used to install entire classrooms of PCs at once.
  • UseModWikiwiki engine licensed under the GNU General Public License. Its page are stored in ordinary files, not in a relational database. Its interface is similar to MediaWiki with the classic skin.
  • W3Perl – logfile analyser, which can parse Web/FTP/Mail/CUPS or Squid files. Most major web logfile formats are supported, as well as split/compressed files.
  • WebGUI – permits non-technically minded users to arrange content in pages and layouts, containing 'Assets' (applets) which permit website visitors to view and interact with various types of data from basic Articles to full-blown Content management system and custom applications. Released under the GNU General Public License.
  • Website Meta Language – extensible web designer's off-line HTML generation toolkit for Unix, distributed under the GNU General Public License (GPL v2). It is written in ANSI C and Perl 5, built via a GNU Autoconf based source tree and runs out-of-the-box on all major Unix derivates.
  • XCAT – Extreme Cloud Administration Toolkit, an open-source distributed computing management software developed by IBM, used for the deployment and administration of Linux or AIX based clusters.
  • Xuheki – web-based Internet Message Access Protocol built upon Ajax technology and supports the Apache webserver.

Perl culture

Perl organizations

Perl personalities

Perl writers

Raku

  • Raku
    • Raku rules – a core part of the language that expands the definition of "regexes" with parsing and pattern matching constructs that exceed the capabilities of formal regular expressions

Implementations of Raku

  • Rakudo

See also

References

  1. Sheppard, Doug (2000-10-16). "Beginner's Introduction to Perl". dev.perl.org. http://www.perl.com/pub/2000/10/begperl1.html. 
  2. Free Software Foundation. "What is free software?". https://www.gnu.org/philosophy/free-sw.html. 
  3. Richardson, Marjorie (1999-05-01). "Larry Wall, the Guru of Perl". Linux Journal. http://www.linuxjournal.com/article/3394. 
  4. Wall, Larry. "perl - The Perl language interpreter". Perl 5 version 12.2 documentation. http://perldoc.perl.org/perl.html#BUGS. 
  5. [1] Tim O'Reilly quoting Hassan Schroeder, Sun's first webmaster]
  6. type at the Free On-line Dictionary of Computing
  7. Shaffer, C.A. Data Structures and Algorithms, 1.2
  8. Castro, Elizabeth (2001). Perl and CGI for the World Wide Web. Peachpit Press. p. 314. ISBN 978-0-201-73568-0. https://books.google.com/books?id=PodQAAAAMAAJ&q=%22Learning+Perl%22+schwartz. Retrieved June 23, 2011. 

External links

  • Perl.org
Community support
  • PerlMonks – a community committed to sharing Perl knowledge and coding tips
Free Perl tutorials
Free on-line books about Perl
Perl scripts