local $ENV{XMLLINT_INDENT} = "\t"; my $linted = "$outfile-lint"; # for readability unlink $linted; system( # here is how we avoid the shell: don't use a string. Use a list qw(xmllint --format --output), $linted, $outfile ); # don't forget to check return code! rename $linted, $outfile;