The poem you are referring to is called "The Walrus and the Carpenter" and it was written by
Lewis Carroll, the author of *Alice's Adventures in Wonderland*.
It appears in his book Through the Looking-Glass, and What Alice Found There, which is a sequel to *Alice's Adventures in Wonderland*.