APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed
RSS Feeds RSS Feeds











(OLDER) <- More Stuff -> (NEWER) (NEWEST)
Printer Friendly Version
->
-> The Genius of the Perl programming language


The Genius of the Perl programming language

by Girish Venkatachalam


Girish Venkatachalam is a UNIX hacker with more than a decade of networking and crypto programming experience. His hobbies include yoga,cycling, cooking and he runs his own business. Details here:

http://gayatri-hitech.com
http://spam-cheetah.com

Programming languages are used to express one's idea in a way that machines understand. Computers need to be told accurately what we have in mind. They do not understand nuances and body language like we humans. Consequently programming languages need a lot of precision and painstaking effort to be told exactly what we want.

Humans work differently. The same thing when told to different people will be interpreted differently and you will get unpredictable reactions. Whereas in the case of computers, you will get the exact same answer. There is a great deal of predictability and convenience in programming languages as opposed to natural languages like English or Tamil.

In the case of natural languages, we find that there is a lot of cultural symbolism associated with language since language forms a vehicle for expression and communication. Consequently different races come with different approaches towards life. And the language they speak clearly mirrors this natural leaning.

I will explain. In India you find that different states are divided on the basis of the language they speak. Each linguistic group has a corresponding culture and tradition associated with them.

We have a lot of similarity in the computer world too. You find that C programmers belong to a certain category of hackers. I think without a doubt you all will agree that the smartest programmers on earth today are not assembly programmers or Java programmers but C programmers. I know that people get religious about programming languages but I want to transcend petty differences and arrive at the truth.

There is no use fighting over which language to use to solve a problem. We sometimes find that we know only certain languages and we can think only in those terms. This is fine but in the long run we may want to pickup other skills and languages that make us more efficient.

After all there is always the idea of the best tool for the job in hand. We can use any tool that serves the purpose but programming languages determine how efficiently and quickly we solve the problem at hand.

I find that the best programming language when applied to a wide variety of challenging problems on the Internet is C. It is called a middle level language as you can do object oriented event based programming for designing user interfaces with it. You also run BGP on Internet's core routers by writing UNIX daemons in C.

But this article is not about C. This article is about perl. But I wish to give C its rightful place. C is the most powerful language that attracts the smartest minds into its fold. As simple as that.

I am sure nobody will get annoyed at the above observation no matter how political you are with languages. But this statement may cause trouble. I will still say it. C++ is different from C. It is very different from C and I have good reason not to comment about it. I will leave it at that.

Having said all that we will deal solely with perl for the remaining part of this article. Perl is the greatest language for all tasks that C complicates. C gives fine grained control and power, but it is also time taking to develop and error prone. We need high level languages for most commonly encountered problems. Perl works admirably well here. Sometimes it works much better than we can imagine.

Python and lua are excellent languages too and I am sure that Python is much better than perl in many many respects but there is one key difference.

The difference is CPAN. You don't have half as many modules as you have in perl in Python. Sure, python lets you do things yourself far easier and elegantly compared to perl. And you also have modules in python and repositories similar to CPAN. But I repeat. There is no CPAN in any language other than perl.

What is the big deal about CPAN?

CPAN is not just a repository of perl modules. It is much more than that. It is a cultural entity with a powerful backend for searching, mirroring and developing modules.

The sheer energy and commitment that goes into CPAN is phenomenal. It is also grand testimony to the power of open source. And it clearly shows how much people care about sharing the result of their toil with others.

You don't have CPAN in python. You don't have it in C or any other language. There may be free libraries in Java and C++. But as I said, it is not about the availability alone. It is about the ecosystem built around it. CPAN has everything and much more.

I think you are getting the drift of my article. Perl is great not just because of its intrinsic features,syntax or semantics. Perl is great because it brought about the CPAN culture.

CPAN modules help you quickly prototype or validate your business idea. You can write anything from quantum physics to file modification with 10 lines of perl code with the right CPAN module.

At least for the sake of tapping into the power of code reuse and open source code sharing, please learn perl. And get comfortable with CPAN. You will never have reason to look back after that.

References

  1. CPAN master site
  2. Perl website
  3. Perl monks
  4. Perl.org




If this page was useful to you, please help others find it:  





11 comments




More Articles by



Click here to add your comments
- no registration needed!




Fri Sep 18 12:33:52 2009: 6930   TonyLawrence

gravatar
I use almost nothing but Perl now, so I agree with your conclusions, but I'll take issue with some of the supporting arguments.

First, minor quibble: computer languages have "regional dialects" also. Consider the handling of echo in sh vs. bash, or redirection in csh. Often programmers are misunderstood because they get the dialect wrong. Also, it's easy to slip into the wrong language when another is very similar - using C style loop constructs in Perl and many other examples - I make these "mixed language" errors quite frequently.

I think the main appeal of Perl is TIMTOWTDI (There is more than one way to do it). Perl gives you far more freedom in programming style. Personally, I don't like authoritarianism anywhere, and Perl is the closest thing to being able to "speak freely" to a computer.

Finally, for me, CPAN is unimportant. For reasons I've discussed at length here, I don't like using other people's code. I'll only do so under duress: just no other way to do it or just not enough time. Otherwise, I will not be downloading any modules: I'll write what I need myself.

But yes, Perl is great. And for those not so stubborn as I am, CPAN is a wonderful resource.



Sat Sep 19 03:48:58 2009: 6936   badanov
http://www.freefirezone.org
gravatar
The main advantage from the point of view of web programming is that CPAN has modules that eliminates the need to break into the shell for needed functions, such as md5 and sha.

Ultimately it comes down to name spaces. Perl has 'em. but php doesn't, and python has an apparently slightly esoteric means of dealing with scope. Perl doesn';t need CPAN because of name spaces unless a program must interface with another application, such as databases of the X-server.

I never learned c but as I understand it most pure non-module programmed functions can translate easily into c.



Sun Sep 20 11:19:28 2009: 6939   AlexandrCiornii
http://chorny.net
gravatar
For me, Perls greatest feature is its community.



Mon Sep 21 14:19:52 2009: 6943   anonymous

gravatar
Bogus article. How much of CPAN is duplication? How much of it are toys (e.g. ACME)? How much of it is unusable crap? How much is left? Oh, right. About as much as can be found in the Python community (probably Ruby as well, etc., etc.).

Of course Java has vastly, vastly more libraries than anyone else.



Mon Sep 21 14:32:22 2009: 6945   TonyLawrence

gravatar
MY feeling is that you either like Perl or you like Python. See my http://aplawrence.com/Unixart/pythonvsperl.html article for more on that.

As to "unusable crap", well, I might not put it quite so harshly, but yeah: I've run into some real junk on CPAN. More likely is something that isn't junk but is badly packaged (has way too many dependencies) or is badly documented - or both.

My bet is that happens just as much with Python, but I'd expect a Python cheerleader to say I'm wrong - and a Perl cheerleader will fault me for saying that about CPAN.

Shrug - the best language is the language you know best. At least until you learn something better.



Mon Sep 21 17:00:16 2009: 6948   SDC
http://logikhaus.blogspot.com
gravatar
Interesting article. I'm a fan of Perl from the pre-Web days, so I have a bit of bias. I don't particularly think the presence of sub-optimal code in CPAN proves anything. If somebody has some involvement even on the edge of the Perl community, it quickly becomes obvious which are the heavy-hitter modules. Also, the presence of crap is kind of a trade-off when openness and freedom to participate is involved.

Contrast this to, say, Microsoft technologies like various .NET languages and VB and VB.NET. If you run into a jam and use Google, prepare to be bombarded with some of the most useless, amateurish code imaginable, which likely has been duplicated and propagated all over the place. As for Java, well, the less said the better. Some interesting things have been built on top of it, but anywhere I'm allowed to use Perl or Python, that's what I'll use.



Mon Sep 21 17:06:01 2009: 6949   TonyLawrence

gravatar
I started using Perl some years ago and never looked back. Php just seems so confused to me and I do not like mixing code into my pages (not that you HAVE to do that, but it's the common usage).

I totally agree about Java, at least for the Web: it's too slow and Google (and others) have shown us that you don't need it for interactive web pages.

And dot-net and all that: words cannot express my disdain.



Tue Sep 22 03:44:13 2009: 6951   badanov
http://www.freeefirezone.org
gravatar
I started learning perl in 2001 and have never looked back, as well. I use php for facing pages, but for non-static content, I use perl.

I had someone tell me at my site I didn't understand the article. Maybe not, but what I think I do understand is that some modules are indispensible for specific functions, such as interfacing with statically compiled applications, such as databases and CGI functions.

Absolutely indispensible.

That said, you can program in perl and bypass modules by breaking into the shell, unacceptable for non-background scripts, so I have been told.

An example of the real genius of perl: I didn't like the two perl date modules I was using for date formatting for a website I did for a customer, so I instead used perl's string functions to format dates the way I wanted. I could have used the date functions, but nooo: I had to go through programming gymnastics to render the date exactly how I wanted.

The point being perl was flexible enough to allow me to go a slightly different route to get to the same place.

That would be the genius of perl, IMO



Wed Sep 23 17:12:58 2009: 6960   GaborSzabo
http://szabgab.com/
gravatar
As already mentioned one of the biggest "features" of Perl is the community. Read many more blogs from the community on IronMan: http://ironman.enlightenedperl.org/



Wed Sep 23 23:45:47 2009: 6964   badanov
http://www.freeefirezone.org
gravatar
Very cool! Bookmarked!



Sat Sep 26 21:48:54 2009: 6970   Keif
http://Http://ikeif.net
gravatar
Interesting article. You reserve some information for brevity's sake it seems - have you written more in depth in the areas you referenced but did not clarify? (C, python, etc.)

Don't miss responses! Subscribe to Comments by RSS or by Email

Click here to add your comments


If you want a picture to show with your comment, go get a Gravatar

Kerio Samepage


Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

Jump to Comments



Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.

I am a Kerio reseller. Articles here related to Kerio products reflect my honest opinion, but I do have an obvious interest in selling those products also.

Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.

We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.

g_face.jpg

This post tagged:

       - Girish
       - Perl
       - Programming







My Troubleshooting E-Book will show you how to solve tough problems on Linux and Unix systems!


book graphic unix and linux troubleshooting guide



Buy Kerio from a dealer
who knows tech:
I sell and support

Kerio Connect Mail server, Control, Workspace and Operator licenses and subscription renewals



Click and enter your name and phone number to call me about Kerio® products right now (Flash required)