So I asked a slightly stupid question where, now that I know the solution, it turns out that the title and most of the question are not actually related with the underlying problem. The actual problem is that I misunderstood how "File::Spec->splitdir" works, but that is barely obvious from the question as I though it was to do with something else. Should I heavily edit the question and title to remove all the unrelated details and focus it on the real problem?
In this particular case, I would not make major changes to the question simply because an actual answer was given (and accepted) that successfully addressed the actual problem.
In a more general sense, I'm very much in favor of stripping questions down to the actual problem as much as possible, as long as sufficient context is in there to both:
The only time(s) when I would be cautious with editing a question substantially is when there have been a number of answers given, especially if they are good answers. In that case, any edits made to the question should be very careful to preserve the full meaning of the original and make sure not to completely invalidate answers already given.
If an original question (that has some answers) is very far away from the actual problem or has the actual issue buried very deeply within it in such a way that pulling it out would be too "damaging" to the original question, I would opt for the "addendum" approach to editing the question. This is more along the lines of adding an additional chunk of stuff to the question, often demarcated in some way (with a line or "EDIT", etc.), that explains the actual or root problem more concisely, along with how you came to realize what the actual problem is.