Orbital-dependent correlation energy in density-functional theory based on a second-order perturbation approach: success and failure.