Perl has always been known for its text processing and manipulation abilities. This article examines the Perl string handling API in greater detail, explaining how you can use Perl's string functions to (among other things) print and format strings, split and join string values, alter string case, and perform regular expression searches.
When Larry Wall first introduced Perl to an unsuspecting world, he had only one goal in mind: to create a language that simplified the task of extracting text and formatting it for display by simultaneously combining the best of sed, awk and C. The result of his efforts, the Practical Extraction and Reporting Language, was so powerful that developers all over the world started using it...and not just for text processing either!
Over the next few years, Perl underwent quite a few rewrites, gradually evolving into a full-featured programming language that could handle almost everything you threw at it. A modular system allowed developers to add to and enhance the language's features with their own custom code, thereby ensuring that the language was always at the forefront of new technologies, and guaranteeing a continuous stream of new converts. As a result, by 1995, Perl was a de facto component of almost every developer's toolkit.
Throughout all this, though, Perl stayed true to its roots. The language was originally designed for string processing and, today, still boasts one of the more powerful string handling APIs in the business. Perl's constructs and functions can deal with strings faster and more efficiently than those in competing languages, and its speed at text processing - string manipulation, comparison, sorting, extracting - make it a great choice for Web developers, who find both speed and power essential to their daily development activities.
Over the next few pages, this article will offer you a broad overview of Perl's string manipulation capabilities, serving as both a handy reference and a tool to help you write more efficient code. Regardless of whether you're new to Perl or if you've been working with the language for a while, you should find something interesting in here.