open ($f[$x],'>','test$x.txt') or die ... ... print { $f[$y] } "whataniceview\n";