The movie is based on the short story "The Lieutenant Died Last" by Graham Greene. It can be found in his anthology titled "The Last Word, and Other Stories". Ironically, in the Preface to this collection, Greene writes, in part, that he missed seeing the movie because he was out of England on war assignment.
The poem from which the title is taken and which appears at the start of the film, is actually the second of four epitaphs written in 1918 by Greek scholar John Maxwell Edmonds. These were written for graves and memorials for those who died in battle. The full epitaph included a heading, "On Some who died early in the Day of Battle Went the day well? We died and never knew. But, well or ill, Freedom, we died for you." Another of Edmonds' epitaphs is "When you go home, tell them of us and say, For your tomorrows these gave their today".