zentara
On Tue, 03 Jun 2003 13:26:31 +0200 Stanislav Valasek
wrote: The other languages may be good or even better than Perl at certain things, but the above reasons should point you toward Perl.
"Python is what Perl should have been." A rough metric: How many people have switched from Perl to Python. A: Many. How many people have voluntarily switched from Python to Perl? A: One was reported, but upon investigation, he could not be found. ;) Python has lots of modules and a large code base also. Not as large as Perl's but enough to help a great deal. Python versus Perl Of the languages discussed here, Python is closest to Perl. The two can be used in similar roles, although the philosophies that determined the designs of the languages are quite different. I knew and liked Perl long before I knew Python. I now use Python for everything I previously used Perl for, so that should give you some idea what this section will say. Without being critical of Perl, I believe Python is the natural successor to Perl. Both languages offer lists, hash tables, object-oriented programming, excellent string handling, and other high-level features. The major difference is conceptual simplicity. Python was built from the ground up as an extensible, structured, object-oriented language; it draws on languages such as C++ and Modula-3 for foundations. Perl was built originally as a replacement for UNIX shell languages, and draws on languages such as Bourne shell, sed, and awk for inspiration. Higher-level features were added later, as it became apparent that the language was being used in areas far beyond what had originally been envisioned. This difference shows up in many aspects of the two languages: In Python, everything -- numbers, strings, lists, hashes, file-objects, and compiled code -- is an object, and can be passed around easily; in Perl, lists and hashes must be cast to scalars to pass them into a function, and then they must be cast back to lists or hashes to be used. In Python, exceptions and exception handlers are an integral part of the language; Perl can achieve the same effect only by encapsulating a call in an eval statement, which produces more awkward code. In Perl, only a string may be used as a key into a hash table; in Python, almost anything can be used. Passing arguments into functions is cleaner and more powerful in Python than in Perl; Python permits named arguments, default argument values, and an number of other things that Perl does not provide. The above is part of the language comparisons in _The Quick Python Book_.