Various sages wanted to hear a recital of the Padma Purana from Lomaharshana, and Lomaharshana told them the story of Shivasharma.
On the shores of the western osean there was a city named Dvaraka (also called Dvaravati). The brahmanas were the first of the four classes and a brahmana named Shivasharma lived in Dvaraka. He was learned in the Vedas and other shastras (sacred texts) and always performed yajnas (sacrifices).
Shivasharma had five sons named Yajnasharma, Vedasharma, Dharmasharma, Vishnusharma and Somasharma. The sons were devoted to their father; they promptly obeyed whatever it was that their father wanted them to do. But Shivasharma was not quite sure about the extent to which his sons were devoted to him. He wanted to test them.
Because Shivasharma had practised various religious rites, he had acquired all sorts of magical powers. He used these powers to create an illusion that his wife had died.
He then told Yajnasharma, “Son, your mother has died and the dead body is cluttering up our house. Take a sword and cut up the body into several pieces. Then throw the pieces away.”
Without questioning what his father had asked him to do, Yajnasharma did what had been asked of him. Shivasharma concluded that Yajnasharma was indeed devoted to his father.
Shivasharma now decided to test Vedasharma. He created a beautiful woman through his powers of illusion, and pointed her out to Vedasharma.
“Now that your mother is dead, I would like to marry again,” said Shivasharma. “Why don’t you ask that woman if she will marry me? I am in love with her and you must do all that is in your power to make her marry me.”
Vedasharma asked the woman to marry his father, but she refused. She had no intention of marrying and old and diseased man and offered to marry Vedasharma instead. But Vedasharma insisted that the woman should marry his father.
“Very well,” said the woman. “I will consent to marry your father. But there is a condition. You must cut off your head with a sword and give it to me as a present. It is only after I get your severed head that I will marry your father.”