Thank you for your reply,
I think you misunderstand me. I need a regex pattern that matches everything following the header to the end of the file. The file contains multiple lines.
The script is able to match the first line, following the header, of each file and append them together into a single file. But I don't want the regex pattern to stop at the first newline, I want it to match all characters, even newline.
I've also been confused by the if ($_ != /\.ktf$/) code, but it's the only thing that worked. It returns true if filename ends with .ktf. It looks inverted to me though... anyway, it works so...