http://www.perlmonks.org?node_id=811918


in reply to Re^2: XPATH DOM traverse html/xml
in thread XPATH DOM traverse html/xml

Absolutely, the way you wrote it is more efficient. I just went for the easiest way I could think of, not knowing enough about the OP's exact constraints.