Being a chronic insomniac, I was sitting up in bed around 4a.m. going over some scripts in my mind, when my brain went off on a tangent. I looked across the room, saw all the text books ( O'Reilly and books from the university ) on my shelf and looked at all the languages I knew. I looked over my O'Reilly books and saw that out of almost 20 books, more than half were PERL related books, when a thought struck me: Why do I like PERL? An odd question since I prefer to do all my coding in PERL, but even odder, I couldn't come up with a decent answer.

Sure I could have gone with technical aspects of PERL and why I like certain operatives, but it didn't seem to cut it. It was like saying, "I like this movie only for its inventive camera angles and artistic subtext," when the movie is just plain entertaining. Yes there are tons of aspects of PERL that make me want to write every program I can in it, but the main reason is that it just entertains me. I discovered PERL as I was learning Linux because Uruk suggested it and I picked up Learning PERL after reading Larry Wall's incredible foreward, and was hooked. I write mainly in JAVA for my classes, and the worst thing about that is I have to wait to finish a program before I can get back to my PERL scripts.

So after deliberating on the subject my mind settled on "I simply enjoy writing PERL where other languages at times bore me." And after scolding my brain for wasting time ( stupid brain! Stop going off on tangents before I stab you with a q-tip ), I settled back into reviewing my scripts.

Note: In no way is this posting suggesting that all languages are inferior to PERL. There are certain things I would never want to code in PERL ( see jcwren's comments on Device Drivers in PERL ). Some things just don't need or can't handle PERL. For instance, when talking to jcwren about embedded systems he mentioned that PERL is just too big to use and he prefers C ( correct me if I'm wrong on that, jcwren ), yet I have seen things that he's written, such as the Perl Monks Stats, and the Amateur Radio Relay, and I get the feeling that perhaps I am not the only one who writes PERL simply because it enterains me.

Macphist0

Everyone has their demons....

Replies are listed 'Best First'.
(Ovid) RE: Late night revelation of PERL
by Ovid (Cardinal) on Nov 06, 2000 at 23:47 UTC
    A long time ago, in a galaxy far, far, away, I used to code in C. It's been over a decade, so I don't remember much of it, but I do remember how incredibly astounded I was that a simple routine that took me a week to code in 8088 assembler (am I dating myself, or what?), would only take a couple of hours in C, yet have almost the same speed.

    Fast forward 14 years: I program in Perl and I have started dabbling in C++. I know that I need more on my resumé than just Perl, mainframe experience and VBA, but I am having trouble getting excited about C++. I look at the hoops I have to jump through for even the simplest of string manipulations and I writhe in agony (anyone know of a C++ regex library?).

    Perl is wonderful because I can get stuff done fast. Sure, we all love the language, but if we couldn't do anything with it, we wouldn't care.

    Cheers,
    Ovid

    Update: My view of a potential job interview.

    Me:Well, I once created a mainframe test region using VBA.

    Potential employer: And this is relevant how?

    Join the Perlmonks Setiathome Group or just go the the link and check out our stats.
      > (anyone know of a C++ regex library?).

      Yes.

      1. Look up the source code by Rosimildo Da Silva, 1998, "based on the implementation of a regular expression engine written by the legendary Henry Spencer originally in "C" around 10 years ago." - at www.connecttel.com.
      I tried it on WinNT about a year ago - it worked. I did not use it much.

      2. If you are into COM on Win32, you can instantiate and call from C++ (or from VB* if you prefer ;-) the RegExEngine that comes with VBScript. Look up the article by Dino Esposito, at www.comdeveloper.com. It works as advertized. I can send you the source code of my console app demo, including a more complete RegExp.h. For the regex doc, look up the VBScript material - at clinic/scripting.

      HTH
      Rudi
      > (anyone know of a C++ regex library?)

      3. There is also PCRE - "a library of functions to support regular expressions whose syntax and semantics are as close as possible to those of the Perl 5 language" by Philip Hazel.

      Rudif
(redmist) RE: Late night revelation of PERL
by redmist (Deacon) on Nov 07, 2000 at 00:31 UTC
    Good point Macphisto, I never thought of it that way. I guess I like Perl because of the Culture that revolves around it. Other languages seem dry, boring, and devoid of life (key word is "seem"...don't kill me). It is one of the most helpful Cultures that I have experienced...and amusing.

    Also, Perl's versatility and applicability in the Real World is super! When I was stuck learning Scheme, I was thinking to myself, what am I doing? The only good thing this language is good for, IMHO, is recursion, and while that is a noble cause, it's not noble enough. I nearly puked when I saw CGI "done" in Scheme. Perl can handle pretty much anything you throw at it and do it well (ie not all kludge like).

    In addition to all this, Perl is fun to code! What other language can you make puns and double entendres in while you code? (BTW, that was a rhetorical question.) I code in Perl because I *want* to, not because I *have* too.

    redmist
    redmist.dyndns.org
    email::redmist
      I came across this site completely by accident. I was hanging about with nothing to do at work after setting up a Linux server and was just browsing around the web. I think I did a google search for PERL and it came up with perlmonks. I was completely hooked. I met a lot of people who's opinion I valued as well as met some people with whom I completely disagreed with on many subjects. I agree that PERL does have the best community. Even those that I disagree with still tend to be helpful.

      Macphisto

      Everyone has their demons....
RE: Late night revelation of PERL
by Adam (Vicar) on Nov 07, 2000 at 01:31 UTC
    I recently had the same thought. I have used (in the last 5 or 6 years in varying contexts) Lisp, C++, Java, and Perl. Of that small set (and limited experience) I have never found a language as flexible as Perl. C++ counts its rigidness as an asset, I do not. As I see it, I want to spend my time implementing code that is directly relevant to the problem at hand, and not to spend time implementing support code.

    For example... say I want to have a dynamically sized array of stuff, in Perl thats what an @array is. In C++, or Java for that matter, I would spend a day just coding the array structure that I want, and then I still would only be able to put one type of thing in it, so I would have to define an object that could contain whatever types of data I wanted to put in the array in the first place, which just gets ugly... fast.

    Perl, on the other hand, has its focus on text. We have regular expressions (RegExes) and split and the concept of a $scalar instead of an array of chars [ ]. Thats what most of us work with. We want to write tools that interact with databases and web servers, scripts for system administration and automation, programs to handle e-mail and play games. Most* of that is text oriented.

    Yeah, you can do math in Perl (and there are plenty of modules at CPAN to help you with the complex stuff), but when was the last time your project was to dynamically calculate the trajectory of a rocket accounting for changes in mass and size over time**? I mean really? (And if your project did involve something that complicated - Please tell me you didn't use Perl! That is definately a C or C++ problem!)

    So my answer is that we like Perl because we can get things done quickly in Perl. We don't need to do any real set-up, because that's been done for us. And that Is A Good ThingTM. You see?***

    Footnotes:
    * I say "most" because we also have common questions like, "How do I generate a random unique number" and "How do I generate a random fully solveable maze?" which are not so much text as they are numerical and logical. But my point stands.
    ** Loss of mass resulting from use of fuel, and change of size in the form of metal expansion at high temprature. These are real issues involved in rocket trajectories.
    *** Actually, there are plenty of other reasons, but that is the one at the top of my top 5 list: Flexability, Ease of learning, Ease of extension, Portability, Community Support.

      I have one bone to pick:

      For example... say I want to have a dynamically sized array of stuff, in Perl thats what an @array is. In C++, or Java for that matter, I would spend a day just coding the array structure that I want, and then I still would only be able to put one type of thing in it, so I would have to define an object that could contain whatever types of data I wanted to put in the array in the first place, which just gets ugly... fast.

      I'm sorry. but if you are in C++, use the STL. It's going to be faster than anything you can do by hand, it's going to be more secure, better tested, etc... than anything you are going to do. It's going to be easy to understand if you are willing to read a bit of documentation. And, most importantly, it's not part of the standard.

      UPDATE: oy, no perlmonking while under chemical influences... sorry extremely but i typed it in wrong. It is part of the new C++ standard. (if i remember correctly, if i am wrong, correct me.)
        This: And, most importantly, it's not part of the standard. ALONE was worth the ++ =)

        --
        $you = new YOU;
        honk() if $you->love(perl)

RE: Late night revelation of PERL
by el-moe (Scribe) on Nov 07, 2000 at 04:18 UTC
    I use Perl; because it's so darn fun!!!

    I work in an industry developing supporting software for CAD/CAM engineering systems. The software we use has traditionally been automated using csh or ksh.

    When the opportunity to take another position with a company that was converting it's approach to using Perl exclusively, I jumped all over it. That was the best thing I ever did for my state of mind.

    I don't ever remember being overcome with silly grinning joy when I did anything in a standard shell. But I have A GIGANTIC GRIN on my face most of the time I'm doing anything in Perl.

    I also use C for some things but as I get better and more fluent with Perl, I suspect I'll be doing everything I can in this fine just fine language.

    So what's the reason I use Perl;???

    I don't think there's any one answer. But I'm almost always smiling while I'm coding Perl. And when I learn something new... which is everyday... it strengthens my resolve to move further down TC's list "The Seven Steps to Perl Mastery".

    But I'm just a geek and the more I know about stuff, the better I feel.

    Prost,
    Moe

RE: Late night revelation of PERL
by Macphisto (Hermit) on Nov 06, 2000 at 23:55 UTC
    A certain compatriot who shall remain un-named...we'll just refer to him a 'jc'...no no that's too obvious, we'll call him 'wren,' has brought up the point that it is Perl, and not PERL as I have it written. So I figured I'd mention that I usually capitalize things that are Acronyms such as PERl being ( Pathologically Eclectic Rubbish Lister ), as well as capitalizing things that are named for references ( such as JAVA being named so because of the enormous amounts coffee imbibed by the writers ). So if you feel it should be Perl, then just squint, and it'll look that way.

    Everyone has their demons....
      As I understand it, Larry Wall named the language Perl, then sometime later he or somebody thought up the 2 commonly accepted expansions.   So it isn't really an acroynm.

      Somewhere around here is a thread where Wiser Monks Than I TM set the record straight.   /me wishes PM search were case-sensitive.   8^\
          cheers,
          Don
          striving for Perl Adept

      Update: Found it - (ar0n; lay off the caps) RE: PERL Mentality.   But I agree, good monk Macphisto - s'not a big deal to me.

        From Learning PERL foreward by Larry Wall:
        "Whatever, the magical bead grew into this rather odd looking Amulet you see before you today. See it glitter, almost like a pearl." (p xiii)

        It could easily be that. But I've always thought of it as an Acroynm. No big deal really.

        Macphisto

        Everyone has their demons....
RE: Late night revelation of PERL
by Fastolfe (Vicar) on Nov 07, 2000 at 00:15 UTC
    For me it's the rapid development time, and to a lesser extent, pretty/elegent code.