$fh[0] = "file1"; $fh[1] = "file2"; $fh[2] = "file3"; open($fh[0], "path/to/file/$fh[0]"); while(<$fh[0]>) { ... } close($fh[0]);