Monday, May 5, 2014

PERL


 PERL(Practical Extraction and Reporting Language)

Perl is a programming language that was created by Larry Wall in 1987 for processing text and generating reports while he was working in Unysis.Slogan of Perl is "There are more than one way to do things"; seems like that is what Lary Wall was thinking while creating Perl because Perl loans it's features from UNIX shell, awk ,sed, C++, Pascal,Lisp and SmallTalk 80(that's a lot of languages) The reason I love Perl is because of its flexibility.For example - As a coder ,it is very frustrating when you get a compilation error because you forgot to parse Integer to float(happens so many times),or when you have to think about whether I should use Integer or short or long to improve the efficiency of my program .. . well ...good news..Perl solves it all.
Just declare a variable like $var=undef;
and forget about its datatype or parsing while assignment operations because Perl does it all for you.
It automatically parses your variable name to the datatype by looking at the value that has been assigned to it and also handles the conversions on its own(Pretty amazing ..Right!!).Some people call Perl as a dirty language because of things like this ,I call it Smart and flexible.
Another feature of Perl that is a boon is CPAN(Comprehensive Perl Archive Network) which is an archive that started in October 1995,where authors like me(fledglings...as of now) and more experienced authors write modules and upload it on CPAN for public use. Example
File Handle Input/Output
Networking Devices
Documentation
Server Damon Utilities
World Wide Web etc
Just download it and use it as your own without fear of copy right issues or anything else.For example Perl "sort" operation implements the  MergeSort module by default hence giving time Complexity O(nlogn) which is as good as it gets without worrying about running complexity for sorting.Even while reading files you don't have to worry about whether it supports UTF-8 ,binary,html,xml encoding; just open a filehandler and read it unlike Scanner class in Java which can be sometimes troublesome with the encoding.
Code for reading a file in perl
open(filehandler,"<Filename");
while($line=<filehandler>){
print $line;
}
Just try this amazing language out,I know you will fall in love with it too.






References-
http://www.perl.org/
http://en.wikipedia.org/wiki/Perl

1 comment:

  1. I’ve been thinking of picking up a scripting language to add to my reservoir of programming languages and was thinking between Python and Perl. When I saw the Perl code, I kind of shied away from it because of the amount of different syntaxes it uses. Python also has a few weird syntaxes, but I believe the overall structure and readability of the Python code is a lot cleaner and easier to understand for some one just starting a scripting language to pick up. I eventually plan to tackle Perl and I hope I end up feeling the same way about Perl as you do.

    ReplyDelete