A Ham in a Role is a 1949 Looney Tunes short directed by Robert McKimson and starring The Goofy Gophers along with an unnamed dog. The cartoon draws heavily from the works of William Shakespeare, with its gags relying on literal interpretations of lines from Hamlet, Julius Caesar, Richard III, and Romeo and Juliet.
An anthropomorphic dog (who also appeared in "The Goofy Gophers" and "Two Gophers from Texas", albeit in slightly different form) is tired of appearing in cartoons and goes home to study the works of Shakespeare. Upon arriving back home, the dog finds that his home has been invaded by gophers. Unfazed, the dog then begins reading Hamlet. Upon discovering the gophers sleeping in the book, he throws the book out the window.
The Goofy Gophers then get their revenge on the dog by literally interpreting lines from Shakespeare works, including "lending him ears," tormenting him with flames (to his foot), dousing him with "the joy of life" (by dumping a tub of water on the dog), dumping Limburger cheese as the dog utters the "that which we call a rose" line while holding a rose, imitating the exhumed Yorick in a dance (making the dog appear like a Shakespearean coward), using magnets on the floor and ceiling to toss the dog around the room (in armor), with the coup de grâce coming about when the Gophers use a horse to kick the dog out of his house and back to the studio, where the dog laments that "parting is such sweet sorrow," returning to the studio where he began the cartoon as the song "You Ought to Be in Pictures" plays in the background. As the cartoon ends, the dog says to the audience "To be...or not to be...", only to get splat by the pie in the face (as in the beginning of the cartoon). Iris-out.