or download this
#!/usr/bin/perl
use strict;
...
print OUTFILE "$reg;;$M4{0};$M4{1};$M4{2};$M4{3};$M4{4};$M4{5};$M4{6};
+$M4{7};$M4{8};$M4{9};$M4{10};$M4{11};$M4{12};$M4{13};$M4{14};$M4{15};
+$M4{16};$M4{17};$M4{18};$M4{19};$M4{20};$M4{21};$M4{22};$M4{23};$M4{2
+4};$M4{25};$M4{26};$M4{27};$M4{28};$M4{29};$M4{30};$M4{31};$M4{32};$M
+4{33};$M4{34};$M4{35};$M4{36};$M4{37};$M4{38};$M4{39};$M4{40};$M4{41}
+;$M4{42};$M4{43};$M4{44};$M4{45};$M4{46};$M4{47};$M4{48};$M4{49};$M4{
+50};$tv;$reg;$date;$reason;$duration_reg;$fmp\n";
close INFILE;
close OUTFILE;