With XML::Twig you don't have to load the entire tree in memory. You could do something like this (untested):
use XML::Twig; my $val; XML::Twig->new( twig_roots => { 'specificParentNode/nodeINeed' => s +ub { $val= $_->text; $_[0]->finish_now; } }) ->parsefile( "my.xml");
Only the NodeINeed would be in memory, and parsing would stop right after finding the value.
In reply to Re: XML parsing vs regex
by mirod
in thread XML parsing vs regex
by derekstucki
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |