in reply to advice on improving performance of this code

That one line in block 1 could be written as:   $record->[1] = join '_', @{ $Map{ $record->[1] } }[1,0]; Block 2 could be written as:
local $, = ' '; local $\ = "\n"; foreach my $record ( @Data ) { print OUT @{ $record->[$i] }[0..4]; }
But I'm not sure how much those will impact performance...

(PS - I'm not so sure using DATA as an output filehandle is such a great idea...)

jdporter
The 6th Rule of Perl Club is -- There is no Rule #6.