In My Backyard Jungle, James Barilla discovers what happens when you set out the welcome mat for wildlife in all its fabulous (and infuriating) forms.

When James Barilla certified his backyard in Columbia, S.C., as a wildlife habitat, his utopian vision for his fifth of an acre wasn’t too far removed from the scene in Snow White and the Seven Dwarfs in which the princess frolics with friendly woodland creatures.

“I thought my kids could get up in the morning, pick strawberries, catch toads and find butterflies, and that would make their day,” Barilla says.

Enter a greedy squirrel (cue villainous music), which wiped out months of gardening work and swiped every last long-anticipated peach and nectarine. The reality check on the challenges of living with wildlife led Barilla to write My Backyard Jungle: The Adventures of an Urban Wildlife Lover Who Turned His Yard into Habitat and Learned to Live with It (Yale University Press, $28) and to ponder the question: Can’t humans and animals just get along?

His quest for peaceful coexistence takes him far beyond his own fence line to communities around the world in which the featured creatures leave much larger footprints than squirrels. In New Delhi, he joins Hindu worshippers in offering bananas — “the international currency in human-primate relations” — to the city’s hordes of rhesus macaques. In Northampton, Mass., Barilla comes unsettlingly close to one of the black bears — and her three cubs — that have taken up residence under porches, behind a junkyard and in other neglected corners of town.

Barilla’s engaging and entertaining story circles back often to his own backyard, which has come a long way from the eyesore he’d inherited from the weed-killer-happy previous owners. Since adding his backyard to the 150,000 other sites certified as wildlife habitat by the National Wildlife Federation, he’s gained a new appreciation for what the term wildlife encompasses. “There’s tremendous diversity,” he says. “Moths, bees, small butterflies — things that are more subtle but that can both use and help the habitat.”

Yes, he has done battle with opossums and squirrels (“It’s an ongoing learning process,” he says), but his first successful nectarine harvest was especially sweet. And his kids do catch toads and find butterflies in the backyard, meaning his Snow White vision wasn’t a complete fairy tale after all.