On Thu, 2009-09-03 at 11:39 +1000, Dave Tang wrote:
> Hi everybody,
> 
> I constantly read about Perl's powerful regular expression matching and  
> string manipulation operators, and how it is superior to other programming  
> languages in this aspect.
> 
> Furthermore, I read this in the wikipedia entry of Perl:
> 
> "The language provides powerful text processing facilities without the  
> arbitrary data length limits of many contemporary Unix tools,[4]  
> facilitating easy manipulation of text files."
> 
> My background is in biology, and learned Perl because people in my  
> laboratory used Perl. As such I don't have experience with any other  
> languages and core programming concepts elude me.
> 
> I wanted to ask why is Perl, in comparison to other programming languages,  
> so powerful in text processing? I read  
> http://en.wikipedia.org/wiki/Perl#Features, and that doesn't really  
> explain to me the answer. My motivation for this question is primarily due  
> to interest and if someday someone asks me how is Perl good for biology  
> (most biological data is stored as flat files).
> 
> Many thanks,
> 
> Dave


I suspect I'll get heavily flamed by a few Perl powers for diving in
well beyond my skill and knowledge (and terminology use!) here, but I'm
also interested so I'll bite.  I suspect part of the answer may well be
the use of so may symbols in perl; $_, $&, `, ', ^ and so on.  Many
languages place a heavier weight on readability (and learnability?) than
Perl does.  In doing so, they sacrifice the terse symbol set that is
such a significant part of Perl.  Those symbols allow you express some
complex ideas... tersely.  Another aspect may well be the use of
contexts in Perl.  For example, if you evaluate something in list or
scalar context, you get something different in many (all?) cases  I'm
not particularly experienced in languages, but I've not seen that
elsewhere.  In an effort to avoid the worst of the flamage for going
beyond my depth, let me turn those ideas into questions;  Am I on the
right track, and hence is my (small but slowly growing) understanding of
Perl going in the right direction?

In any event, I suspect a 'true' answer as to why Perl is so good at
'text' [1] manipulation may be way too technical and dive too far into
the guts of Perl for either of us to fully appreciate.

Why is Perl particularly good for Biology?  No idea, but if you tasks
revolve around data manipulation using small purpose build utilities
rather than full blown massive complex GUI desktop applications then I
can see the attraction of Perl.  I know there are also plenty of Perl
'massive complex' apps out there, but that doesn't seem to be the norm.

[1] I'd also put binary data in there, but it doesn't seem to get as
much attention.

Regards,
Tim Bowden


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to