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.
KeywordsRegular Expression Input Text Blank Line Current Page Manual Page
Unable to display preview. Download preview PDF.