In a large skillet, cook the onions in olive oil on medium-low heat for 20 to 30 min., until soft and golden brown; set aside.
Mix the mayonnaise with chopped rosemary; set aside.
Split the buns crosswise and spread 1 tbsp (15 mL) rosemary mayonnaise on both halves. Layer 2 slices of pork, 2 to 3 slices of pear and a spoonful of caramelized onions on the bottom half of each bun. Close the sandwiches with the top halves. Serve immediately or wrap tightly and keep chilled until ready to serve.