P
P
Hi,
Thanks to your help I have learned how to open files which have
filenames containing foreign characters (like umlauts). I now have
a different, although slightly related problem. I am reading text
from a file. This file is a list of other files, each of which I have
to open for reading. I do something like this:
while (<>) {
# $_ contains one filename
chomp;
open ( IN, $_ ) or die $!;
# do stuff with the opened file
close(IN);
}
This is fine as long as the filename to be opened doesn't contain
foreign characters. It doesn't open such files. For example, if $_
is
"Todo El Ano.log"
then the open() will fail even though the file clearly exists. It has
no problems whatsoever with any filenames containing "normal"
characters.
Is there any way to properly open these kinds of files when getting
their names from a text file?
Thanks to your help I have learned how to open files which have
filenames containing foreign characters (like umlauts). I now have
a different, although slightly related problem. I am reading text
from a file. This file is a list of other files, each of which I have
to open for reading. I do something like this:
while (<>) {
# $_ contains one filename
chomp;
open ( IN, $_ ) or die $!;
# do stuff with the opened file
close(IN);
}
This is fine as long as the filename to be opened doesn't contain
foreign characters. It doesn't open such files. For example, if $_
is
"Todo El Ano.log"
then the open() will fail even though the file clearly exists. It has
no problems whatsoever with any filenames containing "normal"
characters.
Is there any way to properly open these kinds of files when getting
their names from a text file?