Thermally and electrically induced switching in manganese doped perovskites