in reply to print spaces with grep

Two of many ways to get the spaces, the first does the newline after the TITLE line, too.

print map { chomp; $_ . /^TITLE/? "\n" : ' '; } grep { /$re/ } <FILE>;
or
{ local $" = ' '; # just making sure - this is the default print "@{[grep {/$re/} <FILE>]}"; }
The trinary (?:) operator in the first chooses space or newline depending on the first word.

After Compline,
Zaxo