Thank you for your input, and my apology. I realized that my script is grabbing a wrong version of file that already has non-breaking space having as "\_" for some reason. After grabbing the correct version of file set, it's behaving as expected. Thank you as well for pointing me to https://www.perlmonks.org/?node_id=1233709