Your problem is that the "ls -1" system call returns your directory names with a newline character ("\n") appended and you're not removing that character before attempting to open the file. Add a chomp:
if($file=~/^\d/) { chomp $file; $dlist[$x]=$file; }
That being said, you should also:
In reply to Re: problem to open a specified path file in open system call
by tirwhan
in thread problem to open a specified path file in open system call
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |