Print

Print


On Mon, 20 Jan 1997, Joseba Abaitua wrote:
 
> David Megginson replies to Terry Butler, who wrote:
> >
> >  > Is the tagging of a text as much work again as transciption typing
> >  > and proofreading it?  twice as much?
> >
> > This is a difficult question to answer.  Do you know perl?
>
> > In any case, simply adding <div>, <p>, <lg>, and <l> tags to your text
> > will take no time at all -- I wouldn't budget more than the initial
> > entry time * 10% for it.
>
> But why everybody talks about PERL when simpler AWK scripts perform
> similar? Has there been any discussion on why PERL better than
> AWK?! I've been told that PERL is more powerful, but when little
> power is needed, why go the hard way?
 
 
Perl began, like Awk, as a simple language built around a
regular-expression pattern matcher.  Like Awk, Perl is interpreted,
which means it is easy to write short scripts and run them as command
line arguments to the interpreter.  And some of Perl's syntax is
Awk-like, so the transition from one to the other is easy.  Much of the
rest is C-like, so in general, Unix users tend to feel at home in Perl.
 
Perl has since evolved into a very sophisticated language, with built in
data structures like hash tables, stacks and queues, with the ability to
scope and dereference (i.e. pass addresses) variables, and with full
support of Unix IPC.  As of version 5.x, it is also object-oriented
(sort of).  So now you can build robust and reusable (albeit, painfully
slow) tools in Perl.
 
If Awk does what you want, use Awk.  If you find yourself writing Awk
actions and wondering, "Wouldn't it be nice if I could do _this_ in
Awk...", but can't, maybe it's time to check out Perl. Also, keep in
mind that since many people use Perl to process SGML, there are lots of
freeware libraries of routines to get you going.
 
Perl is great because it is very flexible.  But this flexibility
comes at a price.  With so many ways to build up complex data structures,
for example, one person's elegant tercity can look like alphabet soup to
another.  I have a much harder time understanding other people's Perl
code than I do C or C++.
 
        Hope this helps.
 
 
- Gregory Murphy
CETH, the Center for Electronic Texts in the Humanities