TPath::Expression - a compiled TPath expression
version 1.005
my $f = MyForester->new; # make a new forester for my sort of tree my $path = $f->path('//foo[@bar][-1]'); # select the last foo with the bar property my $tree = next_tree(); # get the next tree (hypothetical function) my ($foo) = $path->select($tree); # get the desired node $foo = $path->first($tree); # achieves the same result
An object that will get us the nodes identified by our path expression.
The expression's TPath::Forester.
Variables available during the application of this expression.
Required by TPath::Numifiable. Returns the number of nodes selected given the TPath::Context.
Takes a tree and, optionally, an index and options. Returns the nodes selected from this tree by the path if you want a list or the first node selected if you want a scalar.
The options, if any, will be passed through to the forester's wrap method to define any coercion necessary.
wrap
If you are doing many selections on a particular tree, you may save some work by using a common index for all selections.
Returns whether this expression was created by a case insensitive forester.
TPath::Test, TPath::Stringifiable
David F. Houghton <dfhoughton@gmail.com>
This software is copyright (c) 2013 by David F. Houghton.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install TPath, copy and paste the appropriate command in to your terminal.
cpanm
cpanm TPath
CPAN shell
perl -MCPAN -e shell install TPath
For more information on module installation, please visit the detailed CPAN module installation guide.