A system and method for forming a staple pocket, e.g., on the anvil portion of a surgical stapler device. A laser-machining system may include a laser-emitting device that is configured to emit a laser beam or beams for forming staple pockets on the anvil of a surgical stapler. The staple pockets of an anvil may be formed successively or simultaneously. The anvil of the surgical stapler is mounted in a mounting mechanism so as to control its movement, and the laser-emitting device is controlled by a control module, which may control any aspect of the laser-machining operation, e.g., the intensity of the laser beam, the movement of the laser-emitting device relative to the anvil, etc. The control module may be a processor that includes software that provides instructions for the operation of the control module, and may be programmable by a user for inputting parameters, e.g., shape, arrangement, etc., corresponding to the staple pockets.