Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • He is mostly just complaining about the syntax. So, he is saying that:


    Is uglier than (I agree):




    Is uglier than (meh):


    Reference handling is one of the few things I really don't like about Perl. In a high level language like Perl, you shouldn't have to worry about what's a reference what isn't (most of the time). It goes against DWIM.

    He also complains about having to change the prefix on the array to access the individual element.

    • Honestly, I don't see a problem with the references. You can always write $foo->[3] to dereference the array. And I really don't agree that references and non-references should be interchangable. Since non-refs and refs behave differently, you _have_ to differentiate them. Otherwise this would just scream "action at a distance" to me.

      I can however, understand why non-Perl people have problems with the changing sigils. Because they aren't used to it. Personally, I like it, but I can see why it was decided to be changed.

      It just seems to me that he's complaining that Perl has a different syntax than Python. He can of course do that, but when he starts saying this is why Python is better, it gets ridiculous. I won't even start ranting about the thousands of years old problem that people think they are themselves a statistical majority :)

      Ordinary morality is for ordinary people. -- Aleister Crowley
      • Yeah, it seems like most Lanuage A is better than Lanuage B arguments are really just Lanauge B is different from what I'm used to.
        • Exactly :) That's why I bow before those people who try to transform those silly discussions into "I like $x about $y" and "I hate $x about $y" thoughts. Those are the rants and raves everybody can learn something from. Especially if they are written by people who actually work with that language of course :)

          Ordinary morality is for ordinary people. -- Aleister Crowley
      • Well, when it comes to dereferencing syntax this isn't a problem:

        my @names = keys %$name_age;
        but this is clearly uglier than it should be:

        my @names = keys %{$self->name_age};
        especially when combined with other curly constructs.
        • What’s really annoying is that there’s not even any reason for the prototype on keys (nor, really, on most other functions). Even if keys $foo will blow up at compile time, keys %$foo won’t – but that doesn’t mean the reference is a hash ref. The only reason for keys to have a prototype is because of how the parser works; a mere artefact.

          Context-sensitive sigils worked for Perl 4 because it doesn’t have references; in Perl 5 they are a pointless wart.