A classic episode and one of my favorites! From Season 12 (1961-1962), broadcast November 5, 1961: Jack receives a summons because his rooster is bothering the neighbors. Jack consults a lawyer — Frank Nelson — who learned law by watching Perry Mason. He advises that Jack plead insanity.
Later, Jack dreams that he’s on trial for murdering the rooster, and his lawyer is Perry Mason (Raymond Burr). Perry does a lousy job, and says that it’s because Jack’s writers aren’t as good as his.