$file1 = $InHandles[0]; while (<$file1>){ ... for ($f = 1; $f < @InHandles; $f++){ $file = $InHandles[$f]; $_ = (<$file>); ...