A capsule-based beverage production machine comprises a module (2) designed for producing a beverage on the basis of ingredients (5) which are contained in a capsule (1). The module (2) comprises: —means (3, 4) for retaining the capsule (1) in a fixed position, and—means (6) for perforation the capsule (1), wherein the perforation means (6) are controlled to perforate the capsule (1) after the capsule (1) is retained in the fixed position by the retaining means (3, 4).