“perfume.” The Greek word is muron (#3464 μύρον), and it is a general term for perfume, ointment, perfumed oil, or even a sweet smelling substance. In the New Testament, the emphasis is on the way it smells, and thus “perfume” seems to be the best translation. It is not an “ointment,” per se, because that implies it would be being used for healing. Also, what Mary put on Jesus was likely not oily, so “perfumed oil” is perhaps not the best translation.
“poured it on his head.” This record of Mary (we learn who she is from John) pouring the oil on Jesus occurs in Matthew 26:6-13; Mark 14:3-9; and John 12:1-8. The anointing occurred in the house of Simon the Leper (Matt. 26:6; Mark 14:3), which is why John specifically says Martha was serving. If the supper occurred at the house of Mary and Martha that would never be stated because it would be obvious and expected.
At first glance there seems to be a contradiction between Matthew, Mark, and John, because Matthew and Mark say the ointment was poured on Jesus’ head, while John says the feet. The key is to realize that a flask of oil worth a year’s salary would be quite large, and covered both his head and feet. That is why Jesus said that the woman “poured this perfume on my body” (Matt. 26:12).