In a very simple way "perish the thought" means "forget about it / don't think about it / ignore that thought". For example, I said "I'm afraid I will fail the exam." My friend said "Oh, perish the thought." This expression is not used very often in informal writing or speech. It is used at a higher level of writing and speech. Another example: "I am afraid she does not love me anymore, but I know that's not true, so I should perish the thought" (it means... stop thinking about the negative thought).