清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>
use XML::Parser; my $xmlfile = "yourXML.xml"; my $parser = XML::Parser->new( ErrorContext => 2 ); eval { $parser->parsefile( $xmlfile ); }; if( $@ ) { $@ =~ s/at \/.*?$//s; # remove module line number print STDERR "\nERROR in '$file':\n$@\n"; } else { print STDERR "'$file' is well-formed\n"; }