Unable to explore the rain forest, he soon went a bit stir-crazy. The field station had only two hours of electricity each night, and just enough power to run a 25-watt light bulb. Fortunately for Dr. Janzen, that was a bumper year for moths, which were attracted to the light. So he passed the time building a moth collection.

When he recovered enough to wander back into the rain forest, he discovered that it was also a bumper year for caterpillars. The challenge was to identify which of the many different kinds of caterpillars belonged to which species of moths or butterflies. Now 71, he told me from his field station 32 years later that “my private insanity was to find all of the species before I die.”

To accomplish his goal, he had to set up a system of collecting the caterpillars, photographing each of them, raising them into adults, then identifying each of the species, at least half of which had not been described previously. He started by himself, then was joined by his wife, Dr. Hallwachs, an expert on rodents and now caterpillars. The operation continues to this day, 365 days a year, with the help of 33 trained Costa Rican assistants.

In an area of about 77 square miles, more than 450,000 caterpillars have been studied. As of a few years ago, the team had identified more than 12,000 species. That number ballooned to 15,000 species when the team discovered, through the use of DNA typing, or “bar coding,” that many of the species were actually made up of multiple distinct species, as many as 11 in one case. The total number of species in just this one region equals that of all of the moths and butterflies species of North America.

With caterpillars and chrysalises coming into the station at the rate of more than one hundred a day, Dr. Janzen began to discern a trend. In species belonging to many different groups, he saw caterpillars or chrysalises that bore all sorts of paired eyelike markings of various color schemes, with round or slit pupils. The variety of patterns suggested that the bugs do not have to match exactly the appearance of any particular predator for the ruse to work.

Moreover, the distinct behavior of many caterpillars when handled underscored that the whole game was to startle the many species of insect-eating birds that foraged in the dry, cloud and rain forests of the conservation area. Some eye patterns became visible only when the caterpillars were molested and expanded part of their body, and some large specimens wriggled and rattled like snakes.