But There's More Than One Way To Do It!
use XML::Parser; my $p = new XML::Parser Style => 'stream'; parsefile $p $ARGV[0]; sub StartTag { if (/<vn/) { print "<v n='"; } elsif (!/<v>/) { print; } } sub EndTag { if (/<\/vn/) { print "'>"; } else { print; } } |