By the time writing was invented, the Greeks and Egyptians had already learned to extract opium from poppies to facilitate sleep.