Barn owl with rat in beak

‘Rodenticides are now being linked with a decline in owl numbers.’ Photograph: Corbis

I was bitten by a rat that had taken up residency with my chickens. It’s a long tale with a proper fight, owl noises, a trip to A&E and an orderly singing Rat In Mi Kitchen by UB40 (a truly Birmingham moment).

There is never a good time to get bitten by a rat, but I had plenty of other worries. Lying in bed alone that night, I thought either this brings me down and I never go to the bottom of the garden again, or I accept that I live with rats.

The next morning I donned a pair of gauntlets, grabbed my sharpest spade and tackled the compost, because I knew that is where ratty lay. I didn’t scream or leap, instead I flung my spade at it and missed.

I did go through a poisoning stage for a while, but no amount of poison reduced the rats. They came from the nearby railroad tracks, under the neighbour’s shed, the garden below – “nature abhors a vacuum”.

However, one of the joys of my bit of Birmingham is the owls in the parks. They screech all night, and you sometimes catch them flying by in the neon glow of the street lights. I love those owls; they are one of the reasons I stay. And they are here, in part, because there are so many rats to eat. It takes a rat several days to die from poisoning, long enough time to preyed upon. Rodenticides are now being linked with a decline in owl numbers. If I am to love one, I must learn to live with the other.

I attract rats because I make compost and keep chickens: it’s like a rat B&B. Leaving chicken food out at night is asking them in to dine. Feeding chickens in the afternoon so there are scraps left around is just more encouragement. Hide the food overnight in a ratproof bin. If you can’t do this, try a pheasant spring feeder; the birds tap the spring and it releases a very small amount of food, leaving no waste.

Wild bird seed can be just as attractive. Choose a food that doesn’t make too much mess. Try hulled sunflower seeds, a mix that birds love so they don’t hunt through, scattering the food they don’t like to eat.

Put a tray underneath feeders to collect debris and regularly turn the soil underneath the feeder. Ratty, it seems, isn’t much into digging.

As for the compost heap, it’s all about regularly changing the conditions. Rats are neophobic; they hate change. The more you turn, the more unappealing a place it is to nest. If your bin is constructed so that turning is a pain, invest in a different one. Tumbler composters are the most rat-resistant, because the compost is elevated and sealed away.