Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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 about the Monastery: (4)
As of 2014-07-13 06:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (247 votes), past polls