Ok I figured out a logic to this but I'm still unsure of the syntax to use.
Based on the code above, what I want is to create an array where the value of $currentpath is prepended to each element of the original array.
So if $currentpath is "../"
The original array would produce:
("dir1","dir2","dir3")
and I want a new array which would be:
("../dir1","../dir2","../dir3")
How do I insert $currentpath into the array for each element?