Play It Again, Sam is a 1972 film written by and starring Woody Allen, originally entitled Aspirins for Three. The film was directed by Herbert Ross, which is unusual, as Allen usually directs all his own written work.
The original play and the movie follow the same lines: Allan Felix (played by Allen) has just been through a messy divorce. His two friends, Linda (Diane Keaton) and Dick (Tony Roberts), attempt to convince him to go out with women again. He agrees, and throughout the film, he is seen receiving dating advice from the ghost of Humphrey Bogart (played by Jerry Lacy), who is visible and audible only to Allan. Allan's ex-wife Nancy (Susan Anspach) also makes fantasy appearances, as he imagines conversations with her about the breakdown of their marriage. On occasion, the fantasy seems to run out of control, with both Bogart and Nancy appearing. As the film goes on we see that, when it comes to women, Allan puts on a false mask. He attempts to become sexy and sophisticated, only to end up ruining his chances by being too nervous. Eventually, he develops feelings for Linda, around whom he feels relatively at ease and does not so much feel the need to don the mask. However, as she is married to Dick, their relationship is ultimately doomed, just as it was for Rick (Bogart) and Ilsa (Ingrid Bergman) in the 1942 film, Casablanca. The ending is a parody of Casablanca's famous ending. The fog, the aircraft engine start-ups, the trenchcoats worn and the dialogue are all reminiscent of the film, as Allan nobly explains to Linda why she has to go with her husband, rather than staying behind with Allan.