open STDOUT, "/logfile"; system("my command", "arg1", "arg2") system("gzip","-f","/logfile");