The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

PPIx::XPath - an XPath implementation for the PDOM

SYNOPSIS

  use PPIx::XPath;

  my $pxp  = PPIx::XPath->new("some_code.pl");
  my @subs = $pxp->match("//Statement::Sub");
  my $vars = $pxp->match("//Token::Symbol");

DESCRIPTION

This module simply provides an XPath implementation for the PDOM using Sam Tregar's nifty Class::XPath.

METHODS

new

This expects a single argument which is either a filename or something which inherits from PPI::Node.

match

Given a XPath query string return a list of the nodes which matched.

xpath

Returns an equivalent XPath query string of the current object.

TODO

  • An actual test suite.

BUGS

No known bugs yet, but if you find any, please report them at:

http://rt.cpan.org/NoAuth/ReportBug.html?Queue=PPIx::XPath

SEE. ALSO

PPI

Class::XPath

AUTHOR

Dan Brook cpan@broquaint.com