The phenomenon you refer to is called GAPO. It won't work if you put the book under your pillow. If you put the book under your pillow, then all the facts related to that book get sucked out of your head and into the book.
What you need to do is open the book, put the open book over your head, and then sleep that way. The facts in the book leach out of the pages into your head. While this process also works with the book closed, the covers of the book slow down the osmosis process, so you don't learn as quickly. Besides, an open book is easier to balance than a closed book.
My fellow students and I discussed this thoroughly during veterinary school. There were many experiments performed in an attempt to verify and quantify this phenomenon, but as yet it is still a virgin science, with few practitioners. You'll even find nay-sayers out there who claim that you need to bore an opening into your cranium in order for this to work.
At least, that's what I think they mean when they say you have to have a hole in your head to believe this.