in reply to Problem with matching multiple lines

You can search for the string "(KB\d+)" at the end of line.

while (<DATA>) { if (m/\((KB\d+)\)\s*$/) { print "$1\n"; } }
Update: Sorry, I made a mistake here (0600 here, what do you think :)). You can use this approach:
# Change default separator to \n" $/ = "\n\""; while (<DATA>) { # Put " in the beginning of line. $_ = qq/"$_/ unless m/^"/; # Removes \n s/\n/ /g; }

Igor 'izut' Sutton
your code, your rules.