Running Perl::Critic on Web App?

Running Perl::Critic on Web App?

am 27.03.2008 14:30:39 von Amiri Barksdale

Hi folks:

I am trying to tighten up the code in a web application I have made--I run
HTML::Mason and mod_perl--and I was trying to figure out how to run
Perl::Critic or some other diagnostic tool on the whole thing, so that it
would be active for every request and I could see problems throughout the
whole thing. I tried putting it in my main handler, but it only works on the
handler. I could put a use Perl::Critic on every Mason component, but that's
tedious. Is there a way to run a module on every request at the mod_perl
level?

Amiri
--
View this message in context: http://www.nabble.com/Running-Perl%3A%3ACritic-on-Web-App--t p16325024p16325024.html
Sent from the mod_perl - General mailing list archive at Nabble.com.

Re: Running Perl::Critic on Web App?

am 27.03.2008 14:54:37 von Heiko Jansen

Am Donnerstag, den 27.03.2008, 06:30 -0700 schrieb amiribarksdale:

> I am trying to tighten up the code in a web application I have made--I run
> HTML::Mason and mod_perl--and I was trying to figure out how to run
> Perl::Critic or some other diagnostic tool on the whole thing, so that it
> would be active for every request and I could see problems throughout the
> whole thing. I tried putting it in my main handler, but it only works on the
> handler. I could put a use Perl::Critic on every Mason component, but that's
> tedious. Is there a way to run a module on every request at the mod_perl
> level?

As the Perl::Critic POD tells you, it essentially a static source code
analysis engine.
As such it doesn't make sense to use it they way you describe.
If you are interested how you code performs, you could have a look at
http://search.cpan.org/~fwiles/Apache-DB-0.13/lib/Apache/DPr of.pm
or
http://search.cpan.org/~timb/DashProfiler-1.12/

hth
heiko