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.


In reply to RE: Late night revelation of PERL by Adam
in thread Late night revelation of PERL by Macphisto

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.