KARACHI, Pakistan — When I take my dog for a walk on the beach near my house in Karachi, this is how people react: Mothers tell their kids, look, a dog; kids ask me the dog’s name and if they can touch him; most grown men either recoil or ask me about the price and the breed. Sometimes when I see someone heading to the neighborhood mosque, I cross to the other side of the street. There is a popular belief among the pious that if they come in contact with a dog, they become unclean. You have to take a ritual bath before you can offer your prayers.

Worshipers are usually in a hurry in Karachi. These are perilous times, and I don’t want to come between men of God and God by delaying their prayers. They are, after all, fulfilling their obligation as I am trying to do.

I grew up in a very religious household where dogs weren’t exactly loved, but our faith wasn’t threatened every time a dog appeared on our doorstep. As a teenager in our village in central Punjab, I saw our local imam, who led the prayers, playing with his Russian poodle. His grandsons, who were visiting one summer, brought it and left it behind. I would see the imam with his poodle out on the street, petting her, cuddling her. His long snow-white beard and the poodle’s electric shiny curls sometimes touched. In almost a decade of devoutness that I prayed behind him, I never saw anybody object to his coming into physical contact with a dog. Maybe it was the imam’s authority. Maybe the poodle looked cleaner than some of us peasant worshipers. Maybe people thought a man as old and as pious as he knew what he was doing.

Today, if someone in his position tried to cuddle a dog in public, he would surely lose his status as imam, if not his head. Like Muslims everywhere in the world, we also yearn for more innocent times, when we could stay pure by keeping dogs at bay. There are many more worshipers in the mosques now than there were in my childhood, but there are no imams to tell the religious stories about dog love.