Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re^2: Is it time for 'use stricter'?

by xdg (Monsignor)
on Aug 25, 2005 at 10:36 UTC ( #486500=note: print w/replies, xml ) Need Help??

in reply to Re: Is it time for 'use stricter'?
in thread Is it time for 'use stricter'?

Yup -- that's the way to do it, I think. I wrote "source filter" in the original partly as it was the thing that occurred to me when the joke first came to me and partly to hint that I wasn't being serious. As people started saying "I wish that existed," I realized that to actually do it would need B (or, as diotalevi said, B::Lint) or PPI. And it should really be an external check -- or something easily turned off or commented out for production. You don't really want your CGI script to take 10 seconds to fire up because it's busy checking to see if you wrote q{} instead of ''.


Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

Replies are listed 'Best First'.
Re^3: Is it time for 'use stricter'?
by jthalhammer (Friar) on Jan 13, 2006 at 07:02 UTC
    Perl-Critic does exactly that. It's an extensible static source code analyzer based on PPI. It enforces about 60 of Damian's Best Practices, plus a few others. The current interfaces are the  perlcritic command-line and Test-Perl-Critic which runs via test a script. But I could easily see hooking into a source filter that analyzed the code at compile-time.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://486500]
[Eily]: Hi!
[Happy-the-monk]: Discipulus: si!
[Eily]: Discipulus 2018 has to be better than 2017. The latter was kinda odd, but not we got even :D

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2018-01-23 08:48 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (242 votes). Check out past polls.