Rex Harrison, the suave British actor who won a Tony in 1957 and an Academy Award in 1964 for his portrayals of Prof. Henry Higgins in ''My Fair Lady,'' died of pancreatic cancer yesterday at his home in Manhattan. He was 82 years old. The actor, who was knighted in July 1989, played a wide variety of roles during his long career in theater and films, but he was best known for his portrayal of the waspish professor of phonetics in the musical based on George Bernard Shaw's play ''Pygmalion.'' Sir Rex made his last stage appearance on May 11 in a revival of ''The Circle,'' a comedy by Somerset Maugham. The production, in which he co-starred with Glynis Johns and Stewart Granger, opened Nov. 20, 1989 at the Ambassador Theater. ''He wanted to be on the stage - that was it,'' said Sir Rex's attorney, Harold Schiff. ''He didn't care about retiring.'' ''He died with his boots on, no question about it,'' said Elliot Martin, producer of ''The Circle.'' A popular actor who loved his craft, Mr. Harrison was known for his wit and charm. He was tall and elegant and was often cast as a man of wealth and refinement. In ''The Circle'' he played a British lord whose scandalous past comes back to haunt him. Serious but unpretentious about his work, the actor once said: ''There's always a struggle, a striving for something bigger than yourself in all forms of art. And even if you don't achieve greatness - even if you fail, which we all must - everything you do in your work is somehow connected with your attitude toward life, your deepest secret feelings.'' Mr. Harrison gained international fame with his award-winning stage and film portrayals of the sharp-tongued professor in the Alan Jay Lerner-Frederick Loewe musical. His co-stars as the cockney flower girl Eliza were Julie Andrews on Broadway and Audrey Hepburn in the movie. He was nominated for an Academy Award in 1963 for his other favorite film role, Julius Caesar in ''Cleopatra,'' in which Elizabeth Taylor played the title role. He appeared in more than 40 films, and many stage productions over the decades, in the United States and the United Kingdom, including his portrayal of Henry VIII in ''Anne of the Thousand Days'' (1948), for which he won his first Tony, and ''The Love of Four Colonels'' (1953), which he also directed. Despite all his theatrical experience, Mr. Harrison, a musical duffer, had to work hard on his performance in the first stage production of ''My Fair Lady.'' ''Originally I had a block about appearing in a musical,'' he recalled years later. ''I went to a voice teacher for a while, but that did no good. My range is about one and a half notes. I ended up talking the musical numbers, which was revolutionary at the time.'' ''The lyrics are extremely intricate,'' he added. ''They move along like a precisely acted scene. If you miss a word - heaven help you - the orchestra rattles past like an express train, and you've got to run like the devil to catch up.'' 'Just a New Haven Hit!' After successful warm-up performances out of town, there were still moments of panic during the Broadway opening, on March 15, 1956, at the Mark Hellinger Theater. Mr. Lerner recalled later in his autobiography, ''On the Street Where I Live,'' that the New York audience was disappointingly hushed during the first scene, which had generated much laughter out of town. Aghast, the director, Moss Hart, rushed up to co-workers in the rear of the theater, crying: ''I knew it! It's just a New Haven hit! That's all! Just a New Haven hit!'' Mr. Hart erred. In The New York Times the next morning, Brooks Atkinson wrote: ''Bulletins from the road have not been misleading. 'My Fair Lady' is a wonderful show. As Professor Higgins and Eliza, Rex Harrison and Julie Andrews play the leading parts with the light, dry touch of top-flight Shavian acting.'' ''Although Mr. Harrison is no singer,'' Mr. Atkinson said, ''you will probably imagine that he is singing when he throws himself into the anguished lyrics of 'A Hymn to Him' in the last act.'' ''By that time, he has made Professor Higgins' temperament so full of frenzy that something like music does come out of him,'' he went on. Mr. Harrison recalled in his autobiography, ''Rex,'' which came out in 1974: ''My contract for 'My Fair Lady' was for nine months only - but how could you leave a show like that? It was all far too exciting, and I stayed with it for two years.'' He went on to act for another year in a ''Fair Lady'' production at the Drury Lane Theater in London, where he and the show also had an enormous success. 'By George, They've Got It!' Film critics also applauded the movie ''My Fair Lady'' and Mr. Harrison's performance in it. Bosley Crowther wrote in The Times: ''As Henry Higgins might have whooped, 'By George, they've got it!' They've made a superlative film from the musical stage show - a film that enchantingly conveys the rich endowment of the famous stage production in a fresh and flowing cinematic form.'' Mr. Harrison won further praise from Mr. Crowther for his performance in the film ''Cleopatra.'' ''Caesar is no fustian tyrant,'' the critic wrote, ''Played stunningly by Rex Harrison, he is a statesman of manifest wisdom, shrewdness and magnanimity. And he is also a fascinating study in political ambiguities. Mr. Harrison's faceted performance is the best in the film.'' Rex Carey Harrison was born March 5, 1908, in Huyton, England, a granite-quarrying town six miles east of Liverpool. His parents were William Reginald Harrison, a cotton broker, and Edith Carey Harrison. Stagestruck from boyhood, he went to work backstage for the Liverpool Repertory at the age of 16. His first part was one line; he moved on to other acting parts, then toured for nine years in road companies of successful plays before he made his mark, initially on the London stage, where he appeared for the first time in 1930 and for the last time in 1988, in ''The Admirable Crichton.'' In 1981, Artistic Control Mr. Harrison never attended drama school, but had no regrets on that score. ''The important thing is to learn through experience,'' he said in an interview for The Times before ''The Circle'' opened in 1989. ''The more you do the more you learn. I don't think anyone can teach acting from a podium.'' Mr. Harrison later returned to the role of Professor Higgins, to repeated standing ovations, in a 1981 Broadway revival of ''My Fair Lady,'' in which he was given total artistic control. Lauding Mr. Harrison's re-creation of the part, Frank Rich's review in The New York Times said: ''Yes, he's 25 years older - so are we all, God help us - but he still looks natty in his cardigans, his velvety smoking jacket, his ballroom finery. And he is investing the role of Henry Higgins with a generosity of spirit and mellifluous humor that only years and experience can bring.'' Mr. Harrison was married in 1934 to Marjorie Noel Collette Thomas, with whom he had a son, Noel; to the actress Lilli Palmer in 1943, with whom he also had a son, Carey; to the actress Kay Kendall in 1957; to the actress Rachel Roberts in 1962, and to Elizabeth Rees Harris in the early 1970's. All the marriages ended in divorce except the one to Miss Kendall, who died in 1959. Sir Rex is survived by his sixth wife, Mercia Tinker, whom he married in 1978, and by his two sons. The funeral will be private, but there will be a public memorial service at 11 A.M. June 18 at the Little Church Around the Corner in Manhattan. Don't You Pause, 'Enry 'Iggins? Some of Mr. Harrison's better-known stage appearances were in the following plays: Anne of the Thousand Days, 1948 The Cocktail Party, 1950 Book and Candle, 1950 The Love of Four Colonels, 1953 My Fair Lady, 1956 The Fighting Cock, 1959 Caesar and Cleopatra, 1977 The Kingfisher, 1978 Heartbreak House, 1984 The Circle, 1989 His more than 40 films include: Major Barbara, 1941 Blithe Spirit, 1945 Anna and the King of Siam, 1946 The Ghost and Mrs. Muir, 1947 Unfaithfully Yours, 1948 The Four Poster, 1952 Midnight Lace, 1960 Cleopatra, 1963 The Yellow Rolls-Royce, 1964 My Fair Lady, 1964 Doctor Doolittle, 1967