For more than 60 years, “Perry Mason” has been TV comfort food. The original series ran from 1957-66, and the 271 black-and-white episodes featuring Raymond Burr as the title character — a stalwart lawyer who, more often than not, got the real killers to confess on the witness stand — have been rerun endlessly ever since.

For a number of years, KBYU-Ch. 11 aired old episodes at bedtime, and I know several people who used to watch them as they drifted off to sleep.

WARNING: Do NOT watch HBO’s “Perry Mason” reboot as you’re trying to get to sleep. The first few minutes of the first episode alone are so disturbing you may have trouble sleeping for days.

The new “Perry Mason” is not about the upstanding criminal defense attorney familiar to generations of TV viewers. This period piece, set in 1932, casts Perry (Matthew Rhys, “The Americans”) as a struggling, down-on-his-luck private investigator who hasn’t gotten over the trauma he suffered during World War I or his divorce. He finds solace in alcohol while he’s eking out a living taking compromising photos of Hollywood stars.

Perry gets pulled into the case of a kidnapped and murdered baby — and there’s a horrifying image of the murdered child just minutes into Sunday’s 7 p.m. premiere. (The episode repeats at 8 and 9:30 p.m.) There’s also full-frontal nudity and a rather gross sex scene, so it’s quickly obvious that this is not your grandparents’ “Perry Mason” — and that it’s on HBO.

The case involves crooked cops and a radio evangelist, and it might be the weakest part of the series because it drags on through all eight episodes, with multiple dead ends, red herrings and diversions.

But viewers will be enveloped by the look and feel of this dark “Perry Mason.” And the cast is great — not just Rhys, but John Lithgow as an aging lawyer who’s looking out for Perry; Gayle Rankin and Nate Corddry as the dead baby’s parents; Tatiana Maslany as the radio evangelist; Lili Taylor as the evangelist’s mother; Chris Chalk as a black cop in the nearly all-white LAPD; Stephen Root as the district attorney; and Juliet Ryland as Della Street — who is definitely not the same character she was in the old TV series.

(If you’re familiar with the old show, you’ll recognize several other character names, but the characters are wildly different.)

(Photo courtesy of CBS) Raymond Burr starred as Perry Mason from 1967-66, and then again from 1985-93.

The HBO series is loosely based on Earle Stanley Gardner’s series of “Perry Mason” novels and short stories — as were the six 1930s “Perry Mason” movies; the 1943-55 radio show; the 1957-66 TV show; the 1973-74 TV show (“The New Perry Mason”); and the 30 TV movies (1985-95). This new incarnation definitely won’t be confused with any of those. If it weren’t for the title and the character names, you’d never associate it with its predecessors.

The bottom line is that the atmosphere and the acting are better than the scripts in HBO’s “Perry Mason,” and that’s not a good thing. And it can’t be said too often — be prepared for a dark, violent, disturbing show.

TALKING TO RAYMOND BURR • Way back in 1991, I did a one-on-one phone interview with Raymond Burr for his then-latest “Perry Mason” TV movie: “The Case of the Glass Coffin” — the 19th of 26 he starred in for NBC from 1985-93. I’d been a TV critic for about a year at the time, and I was sort of nervous. Burr had been a TV icon since before I was born, and I had vague memories of my parents watching “Perry Mason” long after I’d been sent to bed when I was a little boy.

Burr had done a lot more of these interviews than I had, and I remember him going out of his way to put me at ease. He was kind and charming, and expressed some surprise that he was still starring in his signature role more than 34 years after he’d first played the character.

He would continue as Perry Mason until he died of cancer two years later. And I still feel lucky that I got to spend a few minutes talking to a TV legend.

OLD “PERRY MASON” EPISODES • When KBYU-Ch. 11 became a broadcast outlet for BYUtv in 2018, that was the end of local repeats of the old “Perry Mason.” If you’re looking for episodes, SundanceTV airs a pair of back-to-back episodes Mondays at 1 and 2 p.m.

And if you really want to binge, all eight seasons of the show are streaming on CBS All Access.