|Do you know where your variables are?|
This is a request.
If you see a question whose form and/or content indicates an extreme lack of clue, then either do not answer or else take the time to explain what you are using. Saying politely that the documentation is helpful is useful but insufficient. For the truly clueless it is useful to give an explanation of how to navigate documentation.
Here is an example of what I mean by an explanation of how to navigate documentation.
Also note that just inspiring someone to learn more does not mean that they know how to do that. For instance you offer an example of a substitution which most Perl programmers should be able to understand. But if someone does not, then they problably do not know about perldoc, do not know what a regular expression is, and will have no way to find perlre. So while I would answer a question with that answer, if I got a follow-up question I would be willing to respond with some combination of an explanation, a mention of perlre, a recommendation for the Owl book, and a recommendation for japhy's YAPE::Regex::Explain.
Furthermore if you can find ways to subtly phrase things in a manner that indicates that you are actively trying to be helpful and impart knowledge, that is always good. For instance rather than just say that someone should have done a search, point to the search engine, say that the search engine is really helpful, and link to the result of a basic search. That passes on the same information but leaves the questioner happier and more likely to follow your advice. I find the small additional energy expenditure more than made up for by the energy savings from less conflict.
Again, if this sounds like too much work for you, then don't answer that question. Move on to a question that looks like it comes from a more sophisticated user. If the question is basic, it is a safe assumption that someone else will answer it. If there is some subtle mistake that you think people are likely to make, then it is typically most useful for all involved for you to wait for someone to misanswer the question, and then politely correct the bad answer. More than anything you can say, this flags the point as something people can easily get wrong. Plus at least one vocal person is now going to pay attention to your answer and is likely to answer the question correctly the next time.
In reply to Re (tilly) 2: Writing answers for newbie questions