actually I don't wanna get rid of the feature but of the syntax.
Then we are (mostly) in violent agreement.
I still think that ++ being special-cased for strings is a rather harmless example, and there is another argument for keeping it: It's nicely symmetric with how ranges of strings work:
$ perl -wE 'say for "a".."e"'
which might be used a bit more often than direct increment on strings.
Now that we've already having this discussion, I'd like to point out some more Perl 5 features that could be reworked to much saner:
- The flipflop (.. operator in scalar context) could have its own operator, making accidental usage of ranges in scalar context much less confusing
- reverse should lose its magic dual functionality (list reversal vs. string reveral) depending on context. Perl 6 uses another function for string reversal (flip), but other approaches are possible too.
- Whitespace is allowed between sigils and the name of the variable. There's no good reason to keep that.
- Indirect method call syntax. (This one is hard to remove).
- The control sequences for newish regex features are really obscure and hard to remember.
But in the long run, removing cruft is only a small part of evolving Perl 5. I firmly believe that in order to stay competitive, it needs a type system(*), proper subroutine signatures and a less bare-bones OO system in core.
(*) If the need for a type system isn't obvious to you, let me just tell you that at least 95% of all the character encoding trouble in Perl 5 could easily be avoided by having separate types for text strings and byte buffers.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
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:
Outside of code tags, you may need to use entities for some characters:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||