Phonon Anharmonicity and Phase Transitions in Perovskites