in reply to Re^2: Cannot open file within a loop
in thread Cannot open file within a loop

it is the correct name if you were in $dir, but you are not, you are in the directory that contains $dir arnt you?

So from the directory containing dir, what is the correct name for the file

Replies are listed 'Best First'.
Re^4: Cannot open file within a loop
by ic23oluk (Sexton) on Jun 14, 2017 at 07:41 UTC

    thanks a lot !! I just added $dir to $file and it worked :)