use XML::Checker::Parser; testFile(); sub testFile() { my $xp = new XML::Checker::Parser(SkipExternalDTD => 1,ParseParamEnt => 1); my $file="test.xml"; eval { $xp->parsefile($file); }; if ($@) { print "$file not passed validation\n"; print "$@"; return undef; } else { print "$file passed validation\n"; return 1; }