Follow the manufacturer directions to lay the foam underlayment and laminate flooring in the first room. Stop at the doorway.
Trim the bottom of the door jambs and moldings. Create a template by placing a piece of laminate flooring on top of a piece of foam underlayment. Use these to cut the bottom of the door jambs and moldings to the correct size. Cut the moldings and jambs with a dovetail saw. Once cut, remove the cut pieces and vacuum out the area beneath the moldings.
Install the foam underlayment and laminate flooring on the threshold of the doorway. Roll out the underlayment per manufacturer directions. Cut the laminate floor pieces to fit the doorway with a table saw. The laminate floor pieces should be cut so that they fit under the door jambs and moldings. Slide the pieces in place, and use a tapping block and hammer to snap the pieces together. Repeat until you can no longer lay a full row of flooring in the doorway.
Take measurements of the remaining space in the doorway. Measure from the last installed laminate flooring row in the doorway to 1/4 inch past the wall of the next room. This measurement is what will need to be cut from the first row of flooring in the next room.
Lay out the foam underlayment in the next room per manufacturer directions. Mark and cut the first row of flooring for the next room. Do not cut the pieces for the doorway; these should be full pieces. Cut the flooring lengthwise on a table saw. Install it per manufacturer directions, connecting it to the full pieces in the doorway. The pieces should fit together easily.
Install the laminate flooring in the next room per manufacturer directions.