sub H_header { # unpack the record into local fields # Write the EOB record } sub D_detail { # parse the input record into different individual fields # write the detail service record } sub C_write_claims { foreach (@claim_recs) { # parse the input record into different fields # write the claim record } }