in reply to problem to open a specified path file in open system call

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:


All dogma is stupid.