in reply to "/" with directory in an array

As pg pointed out, there is something you aren't telling us, and the part you left out is bound to be the part that causes the problem.

How do you know that there is a "/" at the beginning of the first element of your array? The OP code doesn't show anything being done with the contents of @array. Show us the part of the code where you get to see the "/".