The purple worm is a monster in NetHack. It is a popular pet due to its engulfing attack, which can kill many monsters in one hit ("Burrrrp!"). Purple worms will eat shriekers on sight; the reason given for this is that purple worms enjoy eating shriekers.
Purple worms tend to be dangerous if you are unprepared. This is because the purple worm can engulf you, and as soon that happens it will start to digest you ("The purple worm digests you!"). If you are not able to kill the purple worm fast, it will kill you. To ensure survival after being engulfed, immediately zap a wand of digging. The purple worm will have its health points dropped to 1, so one hit will get rid of it. See also engulfing. If you are wielding a cockatrice or chickatrice corpse, stoning the purple worm while inside will give the message: "You jump through an opening in the new statue of a purple worm."
Wearing a ring of slow digestion will prevent a purple worm from killing you via engulfing.
Ranged attacks are of course also an option.
Be careful when leaving pets around purple worms, as they will run up to the worm and promptly be engulfed. Pets that are engulfed die instantly. This is a good way to lose a very powerful pet. This does not apply to pets that are being ridden, however, if a purple worm engulfs you while you are riding, it will force you to dismount and your pet will be vulnerable. For the same reason, however, purple worms make powerful pets, as they can instantly kill things by engulfing them. However, they are extremely vulnerable to shapeshifters because engulfing them alive or eating their corpse will polymorph the worm.
Pet worms can level quickly as well as reach levels beyond their normal maximum by engulfing wraiths.
A gargantuan version of the harmless rain-worm, the purple
worm poses a huge threat to the ordinary adventurer. It is
known to swallow whole and digest its victims within only a
few minutes. These worms are always on guard, sensitive
to the most minute vibrations in the earth, but may also
be awakened by a remote shriek.