in reply to glob is working only first time in foreach loop
my @array[i]=$var;
The syntax errors aside, this line is your error. You are (re)declaring the array every time through the loop. Most likely you wanted to have the array outside of your loop. Also see push for appending elements to an array.
Also, you already have the elements in @files_list. Why are you copying them over into @array?
|
|---|