i am convinced that mark twain , who would have been about nine at the time , either heard or read of teds misadventure in the cave , which may have given him inspiration for his classic book tom sawyer .