That is the law on the books in Pakistan, and where a rapist is found guilty, it is carried out.
In the Western world, rapists get anywhere from 2 years to life sentences for rape. Do you know how many of those rapists actually serve full sentences? Less than 1 in 10.
I suspect in the Western countries, more rapists will serve sentences because of DNA evidence. But what will remain an issue is consent.
Your post echos a published law, but the reality with which I speak is that the arrest rate for that particular crime is beyond rare.