Peel the pearl onions. This is easy to do if you blanch them for 1 minute first. (Put them into boiling water for one minute, then cut of the ends and squeeze gently to remove the peel.)
In a small skillet, saute the onions in butter until they begin to brown. Cover them with water, then simmer with a lid on the pan for a few minutes until the onions are tender. Remove the lid from the pan, add sugar to the water and let the liquid boil away. When the onions are carmelized, remove them from the pan and set aside.
Peel and cut several carrots into rounds. Saute them in the skillet where the onions were cooking, then add a little water to steam the carrots until just tender. Let the water reduce and saute until the carrots begin to carmelize.
Combine the onion and carrots. Season with salt and pepper.