Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: Code Reviews -- List Identifiers

by arkturuz (Curate)
on Nov 22, 2013 at 13:00 UTC ( #1063929=note: print w/ replies, xml ) Need Help??

in reply to Code Reviews -- List Identifiers

There are many options. If you would like to script something of your own, you could use PPI for custom source code analysis. There's also Perl::Critic which is mostly used for this kind of things with its set of predefined rules.

Comment on Re: Code Reviews -- List Identifiers
Replies are listed 'Best First'.
Re^2: Code Reviews -- List Identifiers
by tobyink (Abbot) on Nov 22, 2013 at 17:56 UTC

    Here's a quick PPI example:

    use v5.12; use PPI; my $perl = PPI::Document::->new(do { local $/ = <DATA>; \$/ }); say $_ for @{ $perl->find('PPI::Token::Symbol') }; __DATA__ # Some sample code to analyse my $foo = 1; my @bar = (2, 3); say $bar[0];

    The output includes a variable called $bar which doesn't really exist :-( But that shouldn't be a problem for the OP's use case.

    use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name
Re^2: Code Reviews -- List Identifiers
by Anonymous Monk on Nov 23, 2013 at 07:41 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1063929]
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: (7)
As of 2015-12-01 06:46 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (795 votes), past polls