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