my @records = split($/, $data); #### perl -le '$_="blah\r\nfoo\r\nstuff\r\n"; s/\012/\015/g; s/\015+/\015/g; print join ":", split(/\015/,$_)'