Help for this page
my $xpath = 'BoringNode[1]/InterestingNode[@InterestingAttribute="outg +rabe"]/AnotherBoringNode[5]'; $xpath =~ s|\/(.*?)$||; print $xpath . "\n";
BoringNode[1]/InterestingNode[@InterestingAttribute="outgrabe"]