elsif ($temp =~ (m/^score/i)) { $item_line[$head_count] = $item_line[$head_count] . $& . $'; $item_line[$head_count] =~ s/score //g; ##### need something to parse out unknow word in string here. $head_count ++; $item_count = 0; } ##### writing the file ############### while($a<=$ttl) { $line_count = 0; $write_header = $tmp_headers[$a]; $write_if = $if[$a]; $write_action = $act[$a]; # Write Section Header print FILE "$write_header\n"; # Write If information print FILE "$write_if\n"; # Create item list for the individual section write_items($tmp_headers[$a]); my $t = -1; #### need to put parsed section of string back between $score and $item_line while ($t++ <= $line_count) { if ($item_line[$t] ne "") { print FILE "$score$item_line[$t]\n\n"; } } $a++; }#end while