Okay, Maybe Perl *is* The Problem

chromatic on 2007-05-06T07:40:25

Browse the explanations of the Perl code posted at Worse Than Failure's Splitting Headache. Count how many mistakes there are. Perhaps it really is difficult to use Perl correctly.

Then again, the documentation is copious and I learned from it. I'd say I'd like to meet someone even lazier than I, but that's just too much work.


Too much DWIMmery

Aristotle on 2007-05-06T08:08:01

  • Using capturing groups to return bits of the delimiter as part of the list is pretty obscure.

  • Having trailing empty fields dropped by default is too subtle – you should have to pass -1 to trigger that behaviour instead of to disable it.

  • The “single-space-character string as delimiter” special case is far too clever – the behaviour should be moved to a dedicated separate function or omitted entirely.

I think that is generally the problem people have with Perl: it conflates many things in cleverly disambiguated ways in order to eke out some brevity. Many people can cope with that, and for some it works extraordinarily well, but many also have a hard time mentally keeping the whole enchilada straight.

Thankfully – as I understand so far –, much of Perl 6 is about disentangling such cases. Maybe split needs to be put on that list?