January is not a necessary thing, it certainly

January 28, 2018HISTORY OF PERLPerl, which is also called the Practical Extraction and Report Language, was released on December 18, 1987. Larry Wall, the creator of the Perl language, designed the language to print formatted reports, and by doing so, succeeded in fixing the weaknesses that programming languages had at that time. As a result, the Perl language would take inspiration from languages such AWK, sed, shell script, and C. Perl has also been known more recently as Pathologically Eclectic Rubbish Lister in its own community. Now, it is composed of two languages, Perl 5 and Perl 6. It is not officially an acronym as Wall had named it Perl first, but a backronym, where the word was made first then he and the programming community made names out of the letters. While it is not a necessary thing, it certainly adds a fun and quirky approach to the language.Perl has two slogans: “There’s more than one way to do it”, which is the acronym TMTOWTDI and “Easy things should be easy and hard things should be possible”. The language certainly lives up to these statements, as the language is made so that a programmer could write a line of code in many different ways just as how an English speaker can construct a sentence in multiple ways.The first version of Perl had become popular over the next few years after it was released, with Perl 2 being released a year after the first version, updating the language with an upgraded regex engine. Perl 3 then continued on, with more support for binary data streams. Perl 4 was then released, going through many updates throughout its time. Perl 5 was then launched on October 17, 1994, with the interpreter almost entirely altered. It added features to the language such as lexical variables, references, objects and modules. Below is a general introduction of these topics as they will be further explored in future blog posts and presentations.Lexical variables1. my $x = “perl”;Lexical variables are accessed only within the scope they are declared in. It is declared with the my keyword. If you would like to learn more about how lexical variables in Perl work, this video is very useful.References2. $coderef = @RMDB;This is one way to create a reference. Here, a backlash operator () is the prefix of a variable (RMDB). This creates a second reference to the variable as there is already an existing reference. There are many other ways to create references, and as such, some will be explored in future presentations.Objects3. $anna = new Student(“Anna”, “Galban”, 235479);This is how a programmer can create a Student object in Perl. This line of code is written after the object’s instance has been created.  Modules3. package RM;4. sub print {5. print “Hi, my name is $_0 “6. }7.8. sub display {9. print ” $_0
“10. }Modules are reusable functions from a library file. The keywords require and useare used to load a module.3. require RM;4.5. RM::print(“anna”);6. RM::display(“galban”);Or3. use RM;4.5. print(“anna”);6. display(“galban”);Perl 5 has been an active programming language since its release. Continuing with its advancement, version 5.002 was released and later, version 5.003 had more security features. Later on, the Comprehensive Perl Archive Network was made as a repository for modules and for Perl itself. After Perl 5.004, Perl is supported on Microsoft Windows, Linux and other operating systems. Several other upgrades were made to Perl 5. It made a reputation for being a flexible and an “ugly” language to use as the TMTOWTDI philosophy makes it easier for the programmer’s behalf but harder to read for other programmers. It eventually was referred to as the “duct tape that holds the Internet together” because of its utilization as a glue language that connects software components, and of this “ugliness” that the language has.The concept of Perl 6, a newer version of Perl, was suggested by the programming community in 2000. While upgrading Perl 5, development had started for Perl 6. Several other upgrades were then made to Perl 5 for it to lead to Perl 6. Now, Perl 6 is its own language, released on November 9, 2017, with Rakudo Perl being the only active implementation. The latest stable version of Perl 5 as of this blog’s post date is version 5.26.1. In the next blog, I will be talking about Object Oriented Programming with Perl 5.