can you post more (and working -- that open statement is incomplete and missing a ';') code? Especially how you're reading the input file and taking that data (presumably setting the $CreateViewCmd, $ChangeDirectory, and $LoadViewCmd variables) and your loop structures.