3 \page tidy_scripting Running tidy in scripts
5 If you want to run Tidy from a Perl, bash, or other scripting language you may find it of value to inspect the result returned
8 - \b 0 = if everything is fine
9 - \b 1 = if there were warnings and
10 - \b 2 = if there were errors.
12 \section perl_example_script Example Perl script
15 if (close(TIDY) == 0) {
16 my $exitcode = $? >> 8;
18 printf STDERR "tidy issued warning messages\n";
19 } elsif ($exitcode == 2) {
20 printf STDERR "tidy issued error messages\n";
22 die "tidy exited with code: $exitcode\n";
25 printf STDERR "tidy detected no errors\n";