OK, lose the superfluous paragraph tags
use XML::Parser; my $p = new XML::Parser Style => 'stream'; parsefile $p $ARGV[0]; sub StartTag { unless ($_[0] eq "p" && grep(/^v$/, @{$p->{Context}})) { print }; } sub EndTag { unless ($_[0] eq "p" && grep(/^v$/, @{$p->{Context}})) { print }; } |