in reply to assign variable and shift array
You have a problem if @fileArray > $forkCeiling. Solution: Parallel::ForkManager.