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

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.
  • Comment on Re^13: search and replace strings in different files in a directory

Replies are listed 'Best First'.
Re^14: search and replace strings in different files in a directory
by choroba (Cardinal) on Sep 01, 2014 at 13:08 UTC
    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//;
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ