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

szabgab has asked for the wisdom of the Perl Monks concerning the following question:

use 5.010; use HTML::TreeBuilder::XPath; my $tree= HTML::TreeBuilder::XPath->new; my $html = <<'HTML'; <html> <title>four</title> <head> <title>one</title> </head> <body> <title>two</title> </body> <title>three</title> </html> HTML $tree->parse($html); say $tree->findvalue( '/html/head/title');
I was expecting this to print 'one', but instead it printed 'fouronetwothree'. Am I misunderstand what XPath is supposed to do?

Should I use some other module?