John was the first student to have scored 100% on my final examination.
I was very pleased to have done that.
I was happy to have met John at the meeting.
It is also used for something in the past that did not occur.
He was to have appointed a Chancellor by last month.