The first sentence contains a perfect infinitive.
Examples of the perfect infinitive: to have claimed, to have gone, to have pretended, to have eaten, to have lost, to have drunk, to have seen, to have expected, etc. The perfect infinitive describes the
realization or non-realization of actions: actions which happened,
which may have happened, or ones which are strictly imaginary.
One use of the perfect infinitive is in the main clause of the third
conditional. (Something which could have happened in the past, but did
not, and would have had a result). The perfect infinitive can follow
modal auxiliary verbs (in this case it drops the to).
If I had bought a new motorbike, I would have told you immediately. (neither action happened)
Another use of the perfect infinitive is to refer to a previous time:
I'd rather to have won that game than lost. (to have won refers to the past)
I would prefer to have lived in Tokyo than Singapore. (the speaker lived in Singapore)
Thought to have lived in the sixth century BC, Heraclitus is still an interesting philosopher to many today.
(He might have lived in that century.)
To refer to past actions that did not happen, and no grammatical subject is mentioned:
To have succeeded would have been wonderful. (did not happen)
To have learned French in France would have been extraordinary. (did not happen)
The second sentence is the present infinitive (or simple infinitive): to tell, to go, to eat, to see, to reward, to drink, to throw, to kow-tow, etc.