Chainsaw Perl
Saturday 03 December 2011 at 06:05 am. Used tags: perl
Perl is sometimes called the Swiss-Army Chainsaw of programming languages.
Perl is an interpretive language which can easily be run on Linux and Windows platforms. With strong string handling, file i/o and the fame of the term 'Perl Regular Expressions', Perl has brought an rich and well defined lexicon to the world of procedural definition.
Why Procedural?
Unlike a GUI, a procedure is concise and well defined. While proprietary computing purveyors like Microsoft seek to hide the inner workings of their systems, the fact is we all know that there is a registry. They try to hide the fact that the computer code is text, but they can't entirely.
Perl gets right to the issue, doesn't hide, and short little programs can be quite powerful
Perl and the World Wide Web
Perl became widely used with the CGI server structure with Apache and the world wide web. Scripts in Perl are virtually unhackable in the CGI directory of a website making it an ideal method of managing login methods and secure server functions.
Syntax
Perl's syntax builds on several Linux and Unix boilerplate functions awk, sed, shell and C. Perl also often has many ways to achieve a task, and the resulting code is sometimes compared to APL. Some say that no Perl programmer can read anyone elses code. Nonetheless, skilled perl programmers produce powerful reults and the interpretaive nature allows quick development.
Perl Concatenation
Like PHP, Perl uses the period as the concatenation character.
Weak typing.
While Perl is a powerful text manipulation language, it is not a fast math language, and was not envisioned for heavy math operations. Perl also can perform quickly boolean operations on bytes like && for AND and || for OR.
Hello World with Perl
On your Linux system with Perl, create this program and chmod it to 755.
#!/usr/bin/perl -w
print "Hello World";
If you don't like the lack of a newline, add \n to the end of the output string. This assumes that your Linux system interprets Perl with /usr/bin/perl, this may vary.