#!/usr/bin/perl use strict; use warnings; use Carp::Assert; use IPC::Run qw(start); my ($in, $out); my $colorizer = start [qw(ccze -A -o), 'nolookups,transparent'], \$in, \$out; while () { my $in_header = 1 .. /^$/; my $in_body = /^$/ .. eof; if ($in_header) { print $_; } else { assert($in_body); $in .= $_; } } finish $colorizer; print $out;