Problem with P/E is that it is a retrospective look at earnings - you should use prospective P/E, but that figure is often rubbery...so its not always that easy, but it is a useful indicator, provided earnings aren't too volatile.
Also, how do you use it for a company that made a loss last year, but is growing fast and is expected to make money soon?
I rather use dividend yield...Companies like to keep their dividend yield pretty steady, and have the power to do so, unlike earnings which they cannot control (to a certain extent, i've seen some good earnings management in the past).