Perl::Critic::Policy::Subroutines::ProhibitNestedSubs - C.


Perl-Critic documentation  | view source Contained in the Perl-Critic distribution.

Index


NAME

Top

Perl::Critic::Policy::Subroutines::ProhibitNestedSubs - sub never { sub correct {} }.

AFFILIATION

Top

This Policy is part of the core Perl::Critic distribution.

DESCRIPTION

Top

Attention would-be clever Perl writers (including Younger RJBS):

This does not do what you think:

  sub do_something {
      ...
      sub do_subprocess {
          ...
      }
      ...
  }

do_subprocess() is global, despite where it is declared. Either write your subs without nesting or use anonymous code references.

CONFIGURATION

Top

This Policy is not configurable except for the standard options.

NOTE

Top

Originally part of Perl::Critic::Tics.

AUTHOR

Top

Ricardo SIGNES <rjbs@cpan.org>

COPYRIGHT

Top


Perl-Critic documentation  | view source Contained in the Perl-Critic distribution.