If you were living on a diet of rice cakes, whole-wheat pasta and rye bread, and someone set a pumpkin pie with whipped cream in front of you, you would probably start salivating and dig right in.

Fruit-rotting microorganisms are no different. They want to get at the “good stuff” inside, such as starch and sugar. In order to do this, fungi and bacteria produce digestive enzymes to break down food, just like animals do.

But animals and microorganisms consume food differently. Animals chew food, take in small bits and digest it inside their bodies. Microorganisms, which are, well, microscopically tiny, digest food outside their bodies and absorb the simple sugars that result from digestion.

Plants are built of cells that have firm walls to help the whole plant keep its upright shape. A plant is like a solid mass of bricks (cells) joined by mortar. The bricks are made up of cellulose, while the mortar is pectin, the same substance cooks use to thicken jams and jellies.

As they digest plants, microorganisms break down the cellulose and pectin. While many microorganisms can consume bits of cellulose and pectin, they “hit the jackpot” if they can penetrate through the cellulose in the peel, skin, or rind of fruits to reach the pulp, the same part that animals and humans like to eat.

Some organisms, like the soft rot bacterium Pectobacterium, dissolve pectin in almost any kind of fruit.

The fungus Stagonosporopsis is pickier and causes black rot only on Halloween pumpkin, butternut squash, watermelon and muskmelon.

Sour rot is a soft rot of ripe tomato fruit caused by the yeast-like fungus Geotrichum.

In general, fruit rotters that dissolve pectin cause softer, wetter and messier rots than the organisms that break down cellulose.

Fungi and bacteria don’t take turns eating, unlike like the vultures that spent all afternoon devouring a small carcass in my neighbor’s backyard this past Saturday. Most of the time, one bird was eating, while the rest stood around or sat on the neighbor’s roof, watched and waited.

Microorganisms dive right into a food source, and some fight off their neighbors at the same time by producing various toxins that poison the competition. Some of these toxins are useful to humans as the antibiotics penicillin, cephalosporin and streptomycin, all named after the microorganisms that produce them. These beneficial microorganisms are still the source of these important antibiotics today.

Another microbial toxin is alcohol, produced by yeasts, which are simple fungi, as they decompose fruit or grain.

In a classic paper entitled “Why Fruits Rot, Seeds Mold, and Meat Spoils,” (American Naturalist, 1977), Dr. Daniel Janzen suggests that the toxins that microbes produce in rotting fruit also serve to deter animals and, by extension, humans from eating rotting fruit.

It is easy to imagine that when our ancestors avoided rotting fruit that looked or smelled unappealing or disgusting, they were allowing the particular fungi, yeasts or bacteria in that fruit to survive, that is, to avoid being eaten with the fruit.

Several steps can be taken to discourage microorganisms from rotting fruit. The main reason to stake tomatoes is to raise the fruit off the ground where some fruit rotters live. Placing young squash and pumpkin fruit on a layer of straw serves the same purpose.

When winter squash or pumpkins are harvested, the fruit should be washed with soapy water to remove surface dirt. Afterward, the fruit may be wiped with a clean cloth dipped in a diluted chlorine solution of 1 teaspoon bleach per quart of water. Treated fruit should be allowed to dry but not be rinsed until use.

An alternative to bleach is traditional curing. Curing involves maintaining storage temperatures between 80 to 85 degrees with 75 percent to 80 percent relative humidity for five to 10 days after harvest. One way to do this easily is to leave harvested fruit in the closed trunk of a car.

To preserve a carved jack-o-lantern, place it in the refrigerator during the day when temperatures are 70 degrees or warmer. Cool temperatures slow fruit rots.

For more information on harvesting pumpkins and hardshell (winter) squash, go to http://bit.ly/1o4G49p.

Anthony Keinath is professor of plant pathology at the Clemson Coastal Research & Education Center in Charleston. His expertise is in diseases of vegetables. He is also an avid gardener. Contact him at tknth@clemson.edu.