Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: regexp for finding all function calls

by moritz (Cardinal)
on Jul 07, 2009 at 22:28 UTC ( #778050=note: print w/ replies, xml ) Need Help??


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
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://778050]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (10)
As of 2015-01-30 15:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My top resolution in 2015 is:

















    Results (250 votes), past polls