What I don’t like about Perl

  1. Lack of function prototypes/signatures. OK, actually I just learned to you can do something like “function blah($, $, $)”. But most people don’t. And even then people can (and do) “shift(@_)” anywhere they want within the body of the function. It makes it horribly difficult to figure out how many parameters are needed and what they do and what order, etc. Also it means there is no compile type error checking.
  2. More of that hokey object support.
  3. The ability to call functions with or without parens. Make up your mind.
  4. The “unless” keyword. unless(this == that) { do something; }. Is that really necessary?
  5. Using “unless” or “if” as a suffix to a statement. do something if (this == that); Again, is that really necessary?
  6. eq vs ==, ne vs !=. OK this is Perl’s shell scripting roots peeking out. And I really don’t have a problem with it in that context (and it kinda solves === PHP problem). But it doesn’t mean I have to like it.
  7. The default value shortcut: $something = $that || ‘none’; Seems to be exploiting the short circuit nature of the boolean operators, and is not really consistent with any other language. I really don’t have a problem with this either, but doesn’t mean I have to like it either.
  8. The “many ways” philosophy. Doesn’t that sound like a maintenance nightmare?

Thought I had more, but I haven’t been working heavily with Perl lately.

3 Responses to “What I don’t like about Perl”

  1. Dedoleo Says:

    I’ve noticed most of what you’re talking about though I tend to like it.

    4. Unless is, of course, not necessary, though it may improve readability. To be technical, for loops aren’t necessary either; they’re just convenient while loops. I think Unless is safe to have around seeing as you don’t have to use it if you don’t want.

    5. I think the suffixes really improve readability for one line executions.

    For example,
    if (a == b) {
    print “a equals b”;
    }

    as compared to,

    print “a equals b” if (a == b);

    I find the latter much easier to read and type.


    Perl seems to be an easy-going language and it gets the job done. I agree that the price for being “easy going” is also being a bit messy and having a bit of redundancy.

  2. Dedoleo Says:

    Hmm, interesting. It seems backslashes are added for special characters to go through. However, when I put in the wrong password, that modified text was put right back into the edit window. And then when I put in the correct password, my entry ended up with a bunch of backslashes.

  3. Dedoleo Says:

    .

Leave a Reply