Is buying shared land from someone who has taken possession of it considered halal or haram?
The shared land is possessed by the country i.e. for all people; therefore, it shouldn't be possessed/occupied save by it's guardian/owner permission,thusly it can't be possessed save by having owners' permission. Finally, buying it from a person who don't possess it is impermissible. And Allah Knows Best.
What is the expiation for perjury?
Perjury is forbidden and one of the major sins that require turning to Allah in repentance, seeking His forgiveness, giving back rights to whom they belong, or seeking their forgiveness, and expiating for that oath.
Is it permissible for the guardian, or the father of the child to hit the latter in order to teach him/her good manners?
It is permissible for the guardian to hit his/her child for teaching them good manners once they become ten years old provided that it is done mildly, harmlessly and without intimidation. Actually, such punishment is to be employed gradually i.e. after: asking, warning, and scolding. As for the teacher, he isn`t allowed to hit the student unless the latter`s father approves of it, and it is done according to necessity without intimidation, or harm.
Is it permissible for one to masturbate in order not to commit fornication?
This is called committing the milder of the two evils such as eating a carcass in fear of death, and this happens when committing fornication is very likely to occur.