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

Jim Richardson warlock at eskimo.com
Sat Jan 24 05:06:41 CET 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sat, 24 Jan 2004 03:02:31 -0000,
 Cameron Laird <claird at lairds.com> wrote:
> In article <mailman.720.1074906442.12720.python-list at python.org>,
> Paul Prescod  <paul at prescod.net> wrote:
>>Dietrich Epp wrote:
>>> 
>>>...
>>I would appreciate an example of something you would do by capturing a 
>>message that cannot be done in Python.
>>
>>I rather wonder if you've illustrated the downside of flitting from 
>>language to langauge. You may think you're using a language to capacity 
>>without actually doing so. I could be wrong but perhaps even the tasks 
>>you turn to Lisp or Perl for may have easy equivalents in Python.
>>
>>  Paul Prescod
>>
>>
>
> The comparison with Perl in particular interests me.  I
> often encounter characterizations of Perl (or Ruby--I
> regard them as equivalent in this dimension) as the par-
> agon of text manipulation.  It's not, of course, as Icon
> conclusively demonstrates, at least for me; but I don't
> even see Perl as distinctly superior to Python in text
> mangling.  I recognize that Python REs can feel a bit
> cumbersome, in comparison to Perl, because they essenti-
> ally demand the extra step of explicit compilation.  Is
> that all that people mean, though, when they talk about
> Perl's superiority for text mangling?  Is there more to
> it?

Not sure about superiority. But I find perl useful for those one liners
sed/awk/grep replacements. It's nothing I'd want to use to write
anything more involved, but it's a great replacement/supplement to
tr/cut/grep/awk/sed/etc. 

On the otherhand, where I used to write bash scripts, using all or some
of the above, I tend to use python now, and am much happier for it :)


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAEe9Rd90bcYOAWPYRAh78AKDmi4QnsEcMLfN5HqPHwUJa8ZFGNQCePZ75
Jcu7eTJUh/xAdrtt73s+UaM=
=KZM9
-----END PGP SIGNATURE-----

-- 
Jim Richardson     http://www.eskimo.com/~warlock
Microsoft gives you Windows... Linux gives you the whole house



More information about the Python-list mailing list