in reply to Re^2: regexp for finding all function calls
in thread regexp for finding all function calls

I'd recommend using PPI, which does its best (and a very good job) at actually parsing Perl. You can search through the parse tree for sub calls, and check their names.

That will be much more accurate than anything you can achieve with a regex.

  • Comment on Re^3: regexp for finding all function calls

Replies are listed 'Best First'.
Re^4: regexp for finding all function calls
by marksman (Novice) on Jul 07, 2009 at 22:39 UTC
    Ok, thanks.

    Do you have any good examples for me to look at? Would I be using PPI::Statement::Expression?
      I haven't done much with PPI, but I know that Perl::Critic uses it extensively, so in the source code you'll find many usage examples.

      There are also some examples exaxmples here on perlmonks. Searching helps.