Pro Perl pp 659-711 | Cite as

Text Processing, Documentation, and Reports


This chapter dealt with text processing in depth, building on the concepts of regular expressions and interpolation to carry out advanced text manipulation. To begin with, we looked at text processing modules, including Text::Tab, Text::Abbrev, Text::ParseWords, and the versatile Text::Balanced. We also looked at rewrapping text with Text::Wrap and tokenizing it with Text::Soundex.

Source code is an important subclass of text document. We covered Perl’s Plain Old Documentation (POD) syntax, and saw how to construct it, format it, render it, and write our own tools to parse it. From here we went on to look at preprocessing source files using a source filter. We covered the Filter::Util::Call module and also saw how to simplify some aspects of filter development with the Filter::Simple module.

Finally, we looked at reports, the “R” in Perl, which provide us with a way to create simple templates to format the way output is rendered. We looked at the format data type, formats and filehandles, format structure (including justification), and page control.


Regular Expression Input Text Blank Line Current Page Manual Page 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Peter Wainwright 2005

Personalised recommendations