The most common use of the perfect infinitive is to say ‘after having done’ something. Après avoir fait mes devoirs, j’ai regardé la télé. – After having done/After doing my homework, I watched TV.
There are a few basic rules regarding the use of infinitives and gerunds. Infinitives and gerunds are noun forms. If used before the main verb, they are the subject of the verb; after the main verb, ...