in reply to Clean data - where field contains a CRLF

Here is what I cam up with as a solution using split. I was looking at the Perl Cookbook and the ideas here. This seems to work but is a bit slow with a million records.
#!/usr/bin/perl use strict; my @chunks; { local $/ = undef; @chunks = split(/^(?=(?:EN))/m, <>); } print "Rec: ",scalar(@chunks), " eor\n"; for (my $i=0; $i <= scalar(@chunks); $i++) { $chunks[$i] =~ s/[\r\n]+//g; if ($chunks[$i] =~ /^EN/ ) { print "$chunks[$i]\n"; } }
The bottom bit was just to prove it worked and print out new clean records. I need to do some addtional error checking but this produces a clean file.

Any ideas for improvement?

sxmwb