in reply to Re^11: search and replace strings in different files in a directory
in thread search and replace strings in different files in a directory

╗┐Z:/../file.xml

Seems like BOM.

لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
  • Comment on Re^12: search and replace strings in different files in a directory
  • Download Code

Replies are listed 'Best First'.
Re^13: search and replace strings in different files in a directory
by PitifulProgrammer (Acolyte) on Sep 01, 2014 at 12:49 UTC

    Dear Choroba,

    Thanks for enlighten me, I was not aware of this particular issue. I found out that there is a module for that in perl, but since the code I am using does not use file handles at the crucial part, I am not sure how to use File::BOM correctly. Is there a way to use File::BOM with Path::Tiny or would I have to create a new script?

    Thanks a mil in advance for your comments

    Kind regards

    C.
      I'd just remove the BOM manually before passing the string to Path::Tiny:
      my $directory = shift; my $BOM = "\x..."; # Fill in the actual problematic string $directory = s/$BOM//;
      لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ