I didn't understand how badly I was addicted until I was forced to go cold turkey. It happened during a monthlong retreat to Scotland, where I'd been given a chance to work on my new book uninterrupted by the inconveniences of daily life. The administrators fed me, did my laundry, cleaned my room and the bathroom and left me alone. I didn't have to pay bills or walk the dog or water any plants. They even delivered lunch — silently — in a lovely wicker basket right to my door.

It was my dream of a perfect writing environment, except for one thing: There was no internet or cellphone service. I don't mean in my bedroom, or that it was only in the library, or that it was old-fashioned and slow. It simply did not exist. I'd been so excited about the opportunity, I hadn't stopped to think about how the lack of internet would affect me.

I'm not a digital native. I remember life before personal computers and e-mail. I've never thought of myself as someone who spends a lot of time online. But during those first days in Scotland, the lack of Wi-Fi was horrible. I sat in front of my computer, but instead of communing with my muse, I was anxious, distracted, aware of my heart thumping too loudly in my chest. Classic withdrawal symptoms. Worst of all, I felt claustrophobic, trapped in a foreign country without a car or an Uber connection or the ability to Google a bus schedule.

In the past, safe at home with my high-speed Wi-Fi, I have expounded on the dangers of modern technology. I've lectured my kids, students and friends about how it is lowering our intelligence, ruining our memories, altering the social construct. Parents are on their phones at the park or the beach or while pushing the stroller instead of interacting with their children. Dinner party guests pick up their phones, ostensibly to answer some question — and then surreptitiously check Instagram. The dopamine hit from e-mail, Twitter, texting has been scientifically studied and verified.

At my retreat, I discovered how much I missed that high. At home if I wrote a good sentence, I congratulated myself by checking e-mail. Then I needed to see if those shoes I like have gone on sale, and after that if my sister's cat had surgery — of course accompanied by an upbeat little note to her. She's online a lot so I can count on her to write back quickly and then I reply and on and on it goes.

In Scotland I wanted to post pictures of the rolling countryside and the sheep and receive all the "amazing!" and "so cute!" and "lucky you!" affirmations. But I couldn't tell friends back home how beautiful it was, how delicious dinner had been or how much work I'd done that day. I couldn't even tell my spouse I had arrived, my room was cozy, my fellow writers interesting. I couldn't tell him I wanted to come home. Those first few days I didn't do much writing.

I blamed it on a lack of access to information. I do a lot of research for my novels. Some might say I'm obsessive. It's hard for me to let any little unimportant detail go, what kind of buttons they had on double-breasted suits in the 1970s or what day of the week was March 26, 1998. That first day at the retreat, I was desperate to know the name of those little ceramic cups without handles in a Japanese tea set. It wasn't integral to the plot of my book. No one was in Japan or even really drinking tea; still, I felt I couldn't write the next scene without that single, specific word.

Finally I realized I was agitated not because I couldn't do research or communicate with my spouse. It was much deeper than that. I felt left out, missing what my friends were doing, seeing where they were having lunch or taking walks, or knowing what was blooming in their backyards. Did I even exist if I couldn't share my days, show my cyber community where I was and exactly what I was doing? Why was it so important for me to see and be seen?

The retreat for writers at which I was staying began in the early 1980s, before the internet or cellphones. Writers came and worked — mostly with paper and pen — and sent the occasional postcard, a few of which probably arrived home after the writers. I reminded myself of this, and of the fact that many of my favorite books were written by hand, with all the research done in a library and no one ever knowing how many words the writer wrote in a day.

Little by little I began to work. I had to. There was nothing else to do. I put three asterisks whenever I wanted to research something, so I would know to go back to it later. One day at the end of the second week I discovered I had written without stopping for four hours. I quit wondering what my friends were doing and, more importantly, wishing I could tell them what I was doing. I was enjoying myself and I was very, very productive. I had my five fellow retreat writers to talk with at dinner about our day's travails. I went on long walks as a reward and read books when I needed a break. I took a lot of pictures — my phone was still good for that — but I was taking them for myself.

"No internet is a deal breaker for me," a writer friend said when I told him about the residency. It almost was for me. Instead, the month without it changed me. They say it takes three weeks to break a habit. I hope this habit is broken.

I was home two days before I took out my computer and then only to organize the Christmas dinner potluck.

It's not that I've become a Luddite. I know social media is great for staying in touch with people far away. There is nothing better than the internet for looking up movie times, or to see if a celebrity has died, or checking out the adoptable dogs at the Humane Society. I love having an encyclopedia at my fingertips. But I don't need it all day long. That is my New Year's resolution: to continue to write without interrupting myself, to not check my e-mail and to leave my phone in another room while I'm working.

Meanwhile, my many pages of work from this retreat are speckled with those three-star indicators that research is needed. I've already started filling in the blanks. The Japanese cup without handles is called a yunomi.

Diana Wagman is a novelist and essayist. She wrote this commentary for the Los Angeles Times.