HTML::Mason::Critic::Policy::Template::ProhibitConditionalDeclarations


Warning: These wiki pages have not been edited in years and may well be out of date/inaccurate. We recommend that you use them as a starting point for further investigation, rather than gospel.
Mason doesn't like it when you write variable declarations like this:

my $foo = 'bar' if $baz;

Using this policy will emit violations when it detects this type of variable declaration.

----

This isn't a Mason problem, it's a Perl problem, and you shouldn't do this in your non-Mason code either. That's what the Variables::ProhibitConditionalDeclarations Perl Critic policy is for.