Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Alternatives to sed + awk




On 03/03/11 14:40, Stephen J. Turnbull wrote:
Raymond Wan writes:

  >  I know little about Python, but I usually hear that Python
  >  is good for rapid prototyping while Perl is good for text
  >  processing.

I don't think I'd pigeon-hole either language that way.  Although I
enjoy Perl bashing as much as the next guy, really both are
high-level, general-purpose languages, and it's mostly a matter of
style which you use.  I *personally* find Python much cleaner, even
cleaner than Ruby for that matter, but all of these languages (maybe
including PHP, but that one is very biased toward being run within a
webserver) are general purpose.


Yes, you are right -- they're all general purpose. And it might be I was just duped by some Python-fan. :-)

Learning Python has been on my to-do list for so long now. But when you know another language that is similar, then the motivation to learn a new language even if it is a better tool for the job diminishes. That and the use of indentation instead of parentheses is hard to get use to. I guess I need a "Python on training wheels" which takes my script, removes the parentheses, and then sends it to the Python interpreter. :-)


As Josh says, the one thing that makes Perl stand out is that its
concise (ahem!) syntax, many operators, usually accurate implicit type
coercion, and implicit loop command line options make it very useful
for one liners that otherwise would require several tools hooked
together by pipes.


Some Perl-fans also rave about CPAN modules. Without having seen Python's or Ruby's, I'm not sure about this.

Ray



Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links