my ($handle, $output) = tempfile("tidyXXXXXX", DIR => "/run/validator", SUFFIX => ".dat" ); my $tidy = q(/usr/bin/tidy); my @args = ('-quiet', '-xml', '-file', $output); # process web page with tidy open(TIDY, "-|", $tidy, @args, $tempfile) or die("Could not open '$tidy' : $!\n"); close(TIDY);