“The Principal and the Pauper” was the final episode of “The Simpsons” Keeler wrote; afterward, he jumped ship for creator Matt Groening’s next series, “Futurama.” One of the first “Futurama” episodes he wrote, “When Aliens Attack”, contains meta commentary similar to “The Principal and the Pauper”.

Chunks of the episode are a simple send-off of “Independence Day”; Omnicronian aliens invade Earth and destroy landmarks. What connects this to “Pauper” is Why aliens attack; they want to see the finale of “Single Female Lawyer,” a 20th-century TV show cut from its original run. Omicron Persei 8 is 1000 light years from Earth, so the Omicronians only recently received the series.

Since no copy of the episode exists, the Planet Express team airs its own version. Leela (as protagonist Jenny McNeal) tries to stage a twist ending, leaving the law and proposing to the judge (played by Professor Farnsworth). Fry (and the Omicronians) vetoed that end, forcing Jenny to remain, well, a celibate lawyer. As Fry says, “Smart things make people feel stupid, and unexpected things scare them.” It’s hard not to imagine Keeler thinking about the answer to “The Headmaster and the Pauper” as he writes this line.

“When Aliens Attack” ends with Fry reciting the cardinal rule of television: “At the end of the episode, everything always returns to normal.” The plan then unfolds on New York in flames due to the invasion. However, of course, things are back to normal in the next episode. This, much like the ending of “The Principal and the Pauper,” is Keeler poking fun at the fact that for television writers, the status quo is law.