Demystifying Prompts in Language Models via Perplexity Estimation