Ok for the $x. I did a quick copy and paste from my main script and I forgot a part of it. [I corrected it it the main post]
Anyway this is not important for the test.

Here is my output:
-1-
10
1
-2-
10
193

I also have the error: array reference out of bounds.

If I remove the $FileName = Dir("$path\*.txt") I obtain:

-1-
10
1
-2-
10
1

And I can write in the array without problem.

[ 30. May 2003, 22:21: Message edited by: Christophe- ]