The Spanish perfect infinitive indicates an action that occurred
before the action of the main verb, but only when the subject of
both verbs is the same. The perfect infinitive sounds awkward in
English - we usually change it to another tense or reword the
sentence completely, as you can see in the following examples:
Espero haber terminado antes del mediodía.
I hope to have finished (to finish) by noon.
Gracias por habernos invitado.
Thank you for having invited us (for inviting us).