Python programmers shouldn't get too smug. While many people agree that Python is designed in a way that makes it a highly readable language, there can still be problems with legacy, untested Python code too. Porting legacy Perl to Python can be a daunting task. In this article, learn some of the theory behind dealing with legacy code, including what not to do.

Perl meanwhile became pretty nice again with all these Modern Perl stuff. I dropped Python and Ruby again.

I can see only two language that could compete with it in future. Falcon and Perl 6.

However, bot of them and especially the later one are still to knew.

Perl isn't perfect, but they had plenty of time to fix everything and when it comes to maturity the other simply can't compete. Yeah, OO has been a big problem, but Moose has been there for a while now, if you don't like the old way.

I just can't see an area where for example Python would be better. I mean I've tried it and the only things I can see is that it uses indention and giving me a smaller number of "ways to do it". If I wanted to do it in that way I would simply do it that way. Readability? It's not different from any other programming language. Either you write easy to understand, readable code or hard to understand non-readable code. Everyone of us has seen good and bad Python code I guess.

Yeah, it may be off topic, but I always wondered about that. I mean there have already been new programming languages and it is good to know more than one, but why would I do that switch?

We managed to compile Python 2.6 on an AIX 5.2 server without incident. Perl does have an advantage here, but it's only really an advantage when you are distributing scripts to customers that have no interest in installing Python on their servers, and I believe this case is very rare.

Many of Perl's weaknesses as listed above can be fixed to at least a certain extent by downloading a bunch of CPAN modules that basically modify the language (see the perl5i CPAN module for a good example). However, why bother going through such a huge effort to fix Perl when you can just use a better designed language? Plus, you have to get your team to agree to use all of those modules, and in my experience people who use Perl are quite comfortable with the default language. With Python, everyone starts out on a much higher and more stable ground.

I would _highly_ recommend learning a language before making sweeping statements like this. You really make yourself look like a moron when most of what you say is just flat out wrong. (perl actually does almost all of those things). That being said, I sort of wanted to comment on this

Many of Perl's weaknesses as listed above can be fixed to at least a certain extent by downloading a bunch of CPAN modules that basically modify the language (see the perl5i CPAN module for a good example).

A powerful language is one that can redefine itself to meet its needs. If you have that, you can just release a small core and let libraries define all the fancy language features people like. The neat thing about this is that it lets the language move way faster, since cool language features are often created by people who have a good idea, but aren't interested in hacking on c based VMs. There is a time and a place for that sort of thing, and when you are used to it, languages that don't let you redefine themselves start feeling cumbersome and irritating when that time comes, and you are forced to implement something that could have been done in a much more elegant fashion.

Now, all of that is my opinion, as someone who absolutely loves languages like perl, and ruby, and LISP. I know that not everyone thinks the same way, but a great many really smart people do. Hopefully this is a bit of a window into how the "other side of the fence" sees this sort of thing.

Many of Perl's weaknesses as listed above can be fixed to at least a certain extent by downloading a bunch of CPAN modules that basically modify the language

Modern Perl is ALL about CPAN. The core language distribution has been purposefully kept minimal and it is on CPAN where evolution takes place. In a similar vein key libraries (such as Catalyst) are purposefully kept minimal, with most goodies available as individual modules to be installed separately. A good Perl programmer is nowadays a programmer who knows her way around CPAN. This is an approach that is indeed harder at the start, but immensely more powerful in the long run.

All of these either exist in Perl, too, or don't aid the point: Maintainability.

Iterators and for comprehension are sweet sauce, sure, but once I have a stack of perl code that doesn't use them and works, what exactly is my motivation for porting to python?

A variety of implementations is nice, but does it *really matter* that I there's "only" one source base for perl? I mean, it's open source! It's not like there's a portability problem when the perl interpreter is concerned, it runs everywhere.

I could go on and on.

If you're *starting a new project* then some of your arguments are useful, but we're maintaining code in this article.

Although, in fact, even when starting a new project I would, personally, be prepared to defend Perl's advantages. I've seen far, far more cases, for example, where an interpreter point upgrade breaks python programs. But we

Perl tends to encourage unreadable code, what with all the regex going on.

As it has been said before, it's matter of taste, but do you really think that a long multiline if-then-elseif-elseif-godknowswhat-else block is more readable than a compact regex?
If nothing else, with the regexes you can use all those saved lines for a comment in plain English (or whatever if your native human language)

Perl isn't for everyone. Some people never feel comfortable with Perl. It is quite different from other languages. I am one of those people. Couple of years ago I've replaced parts of old Majordomo 1.9x MLM with my own Perl code, and it worked, but I don't think I've really learned the language....

In fact, I think that people should not try to use Perl code if they are not confident in their Perl skills. It is better for them to write their own modules from scratch and stay away from Perl completely.

Python is much more, well, mainstream, easier to learn, and, majority of people would say that the code is easier to maintain.