in reply to Re: filenames with ’
in thread filenames with ’

print ord($char); shows you the decimal value of the character.

$string =~ s/\213//; attempts to replace the character with octal value 0213, which is decimal 139.

Try instead with $string =~ s/\325//; and you have a better chance it'll do what you want.

You don't say why you are doing this, but if the purpose is to clean up a filename to contain only valid characters (however you define "valid" locally), it would be better to invert the sense to remove everything but the valid characters. Then you might end up with something like:

# allow only letters, digits, underscore and dot (my $cleanfile = $file) =~ s/[^\w.]//g;
Hugo