I did some tests. It is hard to detect whether the log is a 2005 or pre-2005 by its pathname in our case. The best way would be to get the file's BOM before scanning. Do you know how to apply the module File::BOM, so I can use it? Please advise if you do. Thanks and have a great weekend!