$filename = "output.txt"; system("perl /absolute/path/to/program1> $filename");