Well...
The perfect murder is, when thinking about it, impossible to achieve. There are just too many variables to account for, not to mention the random chance that something might go wrong. However, the closest a murder could get to being "perfect" is when all evidence points away from the perpetrator and towards someone who seems more likely to have committed the crime. For example, if a foe of the wo/man happens to be moving away, kill the victim a few days before they leave, it'll make it seem like the foe did it. To make it seem more like they did, kill the victim with something the "foe" has access to or, if possible, something that belongs to them.
It also helps if you have no connection to the victim whatsoever, as authorities tend to investigate those closest to them.