in reply to How to get an exact match of files

Can anyone advise how can I do that?

Anchor your regular expressions or use eq

grep /^\Q$header_file\E$/} @headers
grep { $_ eq $header_file } @headers