Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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
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.

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 exploiting the Monastery: (3)
As of 2015-08-30 14:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (349 votes), past polls