in reply to Re: xml::twig and node names
in thread xml::twig and node names

i was able to improve it by using this :
sub readxml{ $xmlfile = shift; my $twig= new XML::Twig( twig_handlers => { '_all_' => \&fall }, ); $twig->parsefile($xmlfile); } sub fall{ my( $twig, $element)= @_; if (!$element->{att}->{USE} || $element->{att}->{USE} !~ /EDV/){ if ($element->name =~ /fk....\b/){ my $key = substr($element->name,2,4); $data{xml}{$key}++; } } }
but it still takes ~80 seconds...