I have found this sentence in a text book so I suppose it's correct, but I'm a bit confused. I thought that when the verb "need" is used as a modal verb it must be followed by a verb in base form.
The immediate complement of need here is have, which is in base form. Then have takes the complement been, a past participle because this is a perfect construction: not a present perfect but an infinitive perfect.– StoneyB on hiatusAug 27, 2015 at 12:06
Need not by itself is a present tense action, though when have been is added to the end, we are assuming he was previously not needing. i.e. he did not need ____ in the past.
In this example,
[In the past] he did not need to be anxious.
or more like the example
He need not to have been anxious [in the past], though.
I believe it is Present Perfect Continuous, since the phrase is in the present but references the past.