Hacker News new | past | comments | ask | show | jobs | submit login

It's an Algol-based language. I never quite got what people "got wrong" with Perl code. Yes, I've seen bad examples, but those would've looked pretty much the same in C, Pascal or Python (deep nesting, bad names, overuse of regexps).

Back in the days one argument was using "grep" or "map" instead of explicit for-loops, but in this day of functional programming, that would seem a weird criticism.

Is it the type glyphs? ($%@)

References are a bit unnecessary, yes.




Yes, it's the type glyphs. (For me, at least.) Back when I was a DBA writing database back-up scripts in Perl, I could never remember how to dereference a value in an array or hash properly. (It reminded me of my problem with pointer notation syntax in C). When I first saw Python, I thought "Wow, it's like Perl, but without the confusing notation." I rewrote the scripts in Python and never looked back.


> I could never remember how to dereference a value in an array or hash properly.

I too struggled with that and came to hate it.

Perl 6 directly addressed this and some related problems.

First, sigils are now invariant - they're just a part of the name that signals which of the three data structure types a particular variable is. Second, there's no need for a `->` dereferencing op.

  my @array = 1,2,3; # `@` sigil means indexable var
  say @array[1]; # prints 2
It might be interesting to look at an example. Perhaps you could share an example of code in Python that illustrates some data structuring code that would be confusing in Perl 5 syntax, I'll try show what the Perl 6 equivalent would be, and we can see if Perl 6 really does clean this part of the language up.


Nested arrays are a pain on the arse in Python. Do I use extend or append? Then strings are treated as character arrays. I far preferred Perl's approach where you would reference or dereference variables instead.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: