BetZy has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,
I wrote a Perl script for Win2k Platform
What the script does is
1) Opens a file in read mode say a.txt
2) searches for specific file names using regular expression in a.txt
3) Then opens each files listed in a.txt & searches for particular entry in each file using regular expression
4)If entry is found then I am showing that filename on screen

Now when I exceute this script on Windows 2000 English (Professional /Server) the script provides the expected results.But if I execute the same on Windows 2000 German platform the script provides unexpected result.

What could be the problem? Perl Gurus pl. help me & give me a solution.

Additional Info: When I opened a.txt file & displayed its contain on screen on german platform it gave following output
{say a.txt contains Hello.txt system.txt }
On English Platform I get
Hello.txt system.txt

And on German Platform
H e l l o . t x t   s y s t e m . t x t

Because of this my regular expression do not work
Pl. provide me the solution Thanks in advance!

Edited by BazB: remove markup from title, added code tags around output

Replies are listed 'Best First'.
Re: unexpected behavior on Win2k german platform
by ysth (Canon) on Feb 10, 2004 at 06:39 UTC
    I'm guessing the file names are encoding in UTF16. Based on How to read a Unicode file?, try opening your file of filenames like:
    open(FILE, "<:encoding(UTF-16LE)", $filename);
    (You are using perl5.8, aren't you?) It's possible there will be some file names that perl won't be able to open due to character set issues.
      HI,
      Thanks a lot!!!!!!!

      Just using the open(FILE, "<:encoding(UTF-16LE)", $filename); line in script & compiling it on English W2k platform did NOT work,But when I installed ActiveState perl 5.8.2 on W2k German platform & used above line in script it gave me expected results!!
      Now next thing is, I want to convert this script file to exe. (Because I want to make this script to be run without perl interpreter) I used indigostar's perl2exe utility.This works fine on English,but not on German!! Even I installed this on German but the same thing. Do anybody is aware of such utility or solve this problem?
      Again thanks in advance!!
Re: unexpected behavior on Win2k german platform
by Roger (Parson) on Feb 10, 2004 at 06:34 UTC
    Looks like unicode on german platform. You could have a look at Unicode::String or similar to handle unicode conversion.