Migrating to modern Perl, which I admit involves various scripts spanning from "let's use globals only" to "proper architecture and tests". I can tell you the general areas that were problematic, but not the exact situations since I honestly don't remember all of them: Strings with utf8 flag, encoding, etc. - some CPAN modules simply didn't care about it - it's hard to find such bugs (different types are much better for this). Handling half situations with error codes and others with exceptions (I'm not even going into modules which find `dualvar` useful...). Continuing past failures (even if I force some behaviour in my code, other modules don't have to). Possibility to do silly things like mistake `eq` and `==` - if data source changes from number ids to strings, that causes a lot of fun (yes, you can argue this is due to the programmer's inexperience, but then we can't find people who can do this job, let alone those who can both do the job and know perl perfectly). Minor annoyances like re.pl not being very friendly just add to the list.
So yes - of course you can write the best modern Perl and live happily. In practice I have to mess with old code and tricky things left by people saying "Perl is not that bad once you know more of it" - really, it's just setting up someone less experienced for failure. And you can be sure that there will be someone less experienced working on your code (while you're not available for any review). I prefer more explicit code, stopping completely before you do something that might not be exactly what you want.
Re. Perl 6 - it brings in more new syntax, more operators, more different ways to do things, more unknown problems and less people who know it well enough to use it properly. I really don't see the reason to play with it now.
I really don't want this to look like trolling, so I'm not even advocating languages I prefer. You may not agree with me, but this is just something I experienced for the last 3 or so years - those simple problems occur over and over again.
Well, I've had similar problems with others' code in other languages. (Unicode problems are hardly Perl specific. 3rd party libraries will always have different problems. '='/'==', etc.)
What you are really saying is that expressibility is bad?
Cargo cult programmers might get more problems in expressible languages. But these languages are arguably more capable tools for competent programmers. (Moose is the standard example this day -- the OO subsystem ripped out of Perl 5 and replaced with something like Perl 6/Common Lisp.)
I like Perl because of the nice, smart and laid back community -- and because Perl is fun. This makes me motivated. The main disadvantage is the learning curve. (-: Well, and the trolling from the competition... :-)
> What you are really saying is that expressibility is bad?
Almost the opposite, actually. I quite like Haskell and Scala, which can be extremely expressive (no dynamically modifiable parsers though ;) ) - but at the same time the area where you can make a mistake is minimal compared to Perl programs. Things where Perl will leave you a warning (which might get lost in other output), simply won't compile in others (for example ==/eq "problem"). On the other hand you don't need the type annotations for majority of code, so it doesn't induce the verbosity you'd get in Java or others.
Well, I would have no problems with a nice lisp variant, either. Given enough supporting libraries.
Anyone that ignores warning messages will suffer. :-)
Note that Perl 6 is a scripting language which can declare types.
The '=='/'eq' thing is common among scripting languages. It is a detail, you find things like this in all complex packages of rules.
Most scripting languages will get (some) problems with typing, especially in function parameters for the external APIs in libraries. If you use strict, you get away from some classical problems, e.g. variable name misspellings.
With Moose (or other CPAN stuff), you can have powerful typing handling etc.
>>It all goes back to the preference in the end ;)
Let me note -- that is not where you started a few comments ago. :-)
> Let me note -- that is not where you started a few comments ago.
Argh - I have to learn to stop in a good time ;) Actually what I meant is that even if though I really believe in what I wrote above, if I had 10 people skilled in Perl feeling more comfortable with Perl than anything else... it might be a better choice. Should've actually said that experience decides in the end... but let's just stop here already :)
So yes - of course you can write the best modern Perl and live happily. In practice I have to mess with old code and tricky things left by people saying "Perl is not that bad once you know more of it" - really, it's just setting up someone less experienced for failure. And you can be sure that there will be someone less experienced working on your code (while you're not available for any review). I prefer more explicit code, stopping completely before you do something that might not be exactly what you want.
Re. Perl 6 - it brings in more new syntax, more operators, more different ways to do things, more unknown problems and less people who know it well enough to use it properly. I really don't see the reason to play with it now.
I really don't want this to look like trolling, so I'm not even advocating languages I prefer. You may not agree with me, but this is just something I experienced for the last 3 or so years - those simple problems occur over and over again.