If you know how many lines there are in the header
you can just set $HeaderLines to that...($. will be set to the current
line number during each read (I`m assuming you`re using \n as a delimiter))
Since you didn`t mention any other header-delimeter or tags, and said `top of the file`...
that would be my guess