Formats

Perl’s formats are an easy way to make fixed-format template-driven reports with automatic page headers. In fact, they are one of the main reasons Larry developed Perl in the first place, as a Practical Extraction and Report Language. But, alas, they’re limited. The heartbreak of formats happens when someone discovers that he or she needs more than what formats provide. This usually means ripping out the program’s entire output section and replacing it with code that doesn’t use formats. Still, if you’re sure that formats do what you need, all that you’ll need, and all that you’ll ever need, they are pretty cool. See the perlform manpage.

Get Learning Perl, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.