develooper Front page | perl.beginners | Postings from December 2002

Re: two questions

Thread Previous | Thread Next
From:
Paul Johnson
Date:
December 30, 2002 16:41
Subject:
Re: two questions
Message ID:
20021231004057.GB14808@pjcj.net
On Mon, Dec 30, 2002 at 10:10:50PM +0100, Adriano Allora wrote:

> 1 - Perl vs. AWK
> I'm learning Perl to use it in text processing. Recently I start to 
> argue with a friend of mine about the best language to process texts 
> (clear them, or markup them, tokenize them or parse them), he says awk 
> is better - quicker than perl, for example, and easier -.
> I want to learn perl also for cging, but I'm curious about its skills 
> with texts (my friend also forwarded me a mail of AWK mailing list in 
> which someone who did a benchmark demonstrated the speed of awk...)
> Someone want to tell me somethong about it?

I wouldn't go believing benchmarks, unless they are running well written
programs doing what you want them to do and running on your system under
the conditions you want to run them.  I'm sure it's not that difficult
to come up with a set of benchmarks demonstrating how much faster Perl
is than awk.  Do you need that speed anyway?

I would suggest using awk if you need your input record separator to be
a regular expression.  Take a look at $/ in perlvar.

I would also suggest using awk if you know it, you're happy using it and
it does what you want well enough for your purposes.

-- 
Paul Johnson - paul@pjcj.net
http://www.pjcj.net

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About