4.13 Conclusions

4.13 Conclusions

In this chapter, we have discussed at length Perl’s pattern-matching capabilities. Although the chapter is long and has a large number of examples, we are able to discuss the topic only partially. One is advised to read Programming Perl [WCS96] to learn all about regular expressions and pattern-matching in Perl. In addition, to get a detailed understanding of regular expressions in Perl and other languages as well, one should read Mastering Regular Expressions [Fri97].

Perl’s pattern-matching functionality has been inspired by the Unix-based programs AWK [AK88] and sed [DR97]. These are tools that were expressly developed for performing sophisticated pattern-matching tasks in text strings. They come pre-installed in most Unix and Unix-like machines. These are two individual tools that are independent of any programming language. None of the widely-used general purpose programming languages except for Perl provides pattern-matching and regular expression capabilities like Perl does.

String handling is one of the strongest and most unique characteristics of Perl. Of late, the language called JavaScript used for Web client-side programming has started providing some rudimentary regular expressions capabilities [Fla00, Lin99, NS98]. JavaScript programs are run on Web browsers and one of their main purposes is to validate data users enter in HTML-based forms. Java has started to provide a Perl-type regular expressions capability in recent years.

Quite often, the unparalleled string handling prowess of Perl attracts a programmer to venture into using Perl for the first time. Human communication in a modern society often takes place in terms of written words, and Perl provides a perfect general purpose programming language to parse and analyze such communication. The string handling capabilities often are used in artificial intelligence and information processing. The World Wide Web is an extremely large and ever-growing repository of human knowledge—good or bad, general or specialized, mundane or exotic. Perl is often used to mine hidden information from the vast expanse of the Web. Perl is also used in traditional data mining from
databases. The growing and emerging field of bioinformatics uses Perl extensively to perform sophisticated string matching it its quest to map the genome of humans and related animals.