in reply to How to remove wide chars (ex: 年 or 或) from a text file?
now $string no longer has $badstuff, whatever it ismy $badstuff = read_file( $file, { binmode => ':raw' } ); $string =~ s/\Q$badstuff\E//;
see File::Slurp, binmode, quotemeta, Data::Dump
|
|---|