Resistance switching in perovskite thin films