Lay your carpet down and make sure it is centered and lays directly against the doorway.
Finish carpet in doorway.
I use a hook bill to do this.
Use your utility knife to cut the carpet to the size of the room adding an extra 4 to 6 inches on each side.
If you nail one down always nail it to the subfloor and not to the pergo flooring.
Smooth out the carpet over the doorway and feel it with your hands to locate the area where it meets the other type of flooring.
If have to butt pergo against an existing metal track for a sliding door leave a 1 4 inch gap between the doorway and the floor and fill the gap with acrylic latex or silicone caulk.
But when the last few floorboards of your laminate floor need to be laid under the door jambs or through the door lining or door frame it seems impossible to get them in without.
During the flooring installation laying laminate in a doorway perfectly is not so difficult when you start laying the floor boards at the wall that has the door in it.
Just push the edge of the carpet down into the gap all the way across the door and trim any strings off.
Place a straightedge on top of the carpet and cut along the line using a utility knife to trim off the excess.