... open FILE, 'test.txt' or die "Error message here: $!\n"; binmode FILE; ...