in reply to Regex not greedy enough

Assuming you have the entire thing in the string, I would suggest split()ing with lookahead:
# split RIGHT BEFORE a \n followed by 'record' @records = split /(?=\nrecord)/, $data;


$monks{japhy}++ while $posting;