value of @command array after the first iteration of @files is $command[0]=08-1.txt $command[1]=08-2.txt but for the second iteration of @files value of @command array :- $command[0]=09-1.txt 09-2.txt $command[1]=empty. why this is happening? i want the value to be $command[0]=09-1.txt $command[1]=09-2.txt can anyone please help?