I agree with all of the answers so far.
I want to note that in American English, we rarely use "perhaps" in writing or speaking. "Maybe" is our common word for both. In a sentence, we may also insert "possibly" or forms of "possible" instead.
Perhaps he may change his ways, if he falls on his face.
Maybe he will change his ways if he falls on his face.
If he falls on his face, it's possible he may change his ways.
Hope this helps! :)