print "Content-type: text/html\n\n"; print "
\n"; print "Blah Blah. For another enquiry Click Here\n"; print ""; my $stdout = "stdout.txt"; my $newstdout = 'C:\SomeDir\SomeSubDir/' .$stdout; my $stderr = "stderr.txt"; my $newstderr = 'C:\SomeDir\SomeSubDir/' .$stderr; # redirect STDOUT & STDERR open (my $oldstdout, ">&STDOUT") or die "Can't open old STDOUT: $!"; open (my $oldstderr, ">&STDERR") or die "Can't open old STDERR: $!"; open (STDOUT, ">$newstdout") or die "Can't open STDOUT: $!"; open (STDERR, ">>$newstderr") or die "Can't open STDERR: $!"; my $zip_options = "-a"; open OUT, "| $winzip $zip_options $zip_file $filetoZip" or die "wzzip pipe: $!"; print OUT "\n"; close OUT;