while (my ($line) = $record->{data} =~/(.*)\n/g) { ... }