Perl vs. Python for text manipulation (was: [OPINION] - does language really matter if they all do the samething?)

Ville Vainio ville.spamstermeister.vainio at thisisspamprotectiontut.finland
Sat Jan 24 04:41:46 EST 2004


>>>>> "Cameron" == Cameron Laird <claird at lairds.com> writes:


    Cameron> conclusively demonstrates, at least for me; but I don't
    Cameron> even see Perl as distinctly superior to Python in text
    Cameron> mangling.  I recognize that Python REs can feel a bit

Me neither. People seem to think that if a language is specialized to
some task, it must be superior to a language that isn't specialized to
the task for performing that very task. I don't see any truth in that
logic.

    Cameron> cumbersome, in comparison to Perl, because they essenti-
    Cameron> ally demand the extra step of explicit compilation.  Is

And even that isn't needed: re.search("hello.*ld","hello world"). 

    Cameron> that all that people mean, though, when they talk about
    Cameron> Perl's superiority for text mangling?  Is there more to
    Cameron> it?  --

I think there is the argument of perl being faster in some such
tasks. That shouldn't really matter for most text processing tasks
that are batch runs anyway.

Someone should just write a "dirtypython"-module, and importing * from
the module would get all the shortcuts that make Python seem more
verbose than perl:

rs = re.search
s = re.sub

And perhaps add a lot of magic to the functions that cripple the
general purpose usability, but make "common tasks" more
concise. Voila', Perl.

-- 
Ville Vainio   http://tinyurl.com/2prnb



More information about the Python-list mailing list