Seems like you have two basic tasks:
- read a row of records
- split up the columns into three individual records
The latter has been discussed. For the former, if you have blank lines only in between rows, look up what happens when
$/ = "" (paragraph mode) in perldoc perlvar.