It seems to work by restricting the parts of your brain that make you sluggish or sleepy.
Since good sleep is needed to solidify learning for the long term, I personally will be unlikely to ever try provigil, at least not for more than a couple-day sprint. Getting a good sleep when my brain is full is an investment in long-term productivity (better retention of learning) over short-term productivity.