{ $fileArray[$currIndex++] = splice(@$arrayRef,$i--,1); } } push (@$arrayRef, @fileArray); }