package File::Find::Rule::WellFormed; use strict; use vars qw($VERSION); use base qw(File::Find::Rule); use File::Find::Rule; use XML::Parser; sub File::Find::Rule::wellformed () { my $self = shift->_force_object(); $self->exec(sub { eval { XML::Parser->new->parsefile(shift) } }); } 1; __END__ =head1 NAME File::Find::Rule::WellFormed - Find well-formed XML documents =head1 SYNOPSIS use File::Find::Rule qw(:WellFormed); my @files = find(wellformed => in => $ENV{HOME}); =head1 DESCRIPTION C extends C to find well-formed (or not well-formed) XML documents, by providing the C test: my @wellformed = File::Find::Rule->new ->file ->name('*.xml') ->wellformed ->in('/'); The C test can be reversed, per standard C semantics: # OO my @malformed = File::Find::Rule->new ->file ->name('*.xml') ->not_wellformed ->in('/'); # functional my @malformed = find('!wellformed' => in => '/'); C takes no arguments. =head1 SEE ALSO L, L, L =head1 AUTHOR darren chamberlain Edarren@cpan.orgE