Ricardo SIGNES > Perl-Critic-Tics-0.006 > Perl::Critic::Policy::Tics::ProhibitManyArrows

Download:
Perl-Critic-Tics-0.006.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.006   Source   Latest Release: Perl-Critic-Tics-0.009

NAME ^

Perl::Critic::Policy::Tics::ProhibitManyArrows - (this => is => not => good)

VERSION ^

version 0.006

DESCRIPTION ^

You are not clever if you do this:

  my %hash = (key1=>value1=>key2=>value2=>key3=>'value3');

You are even more not clever if you do this:

  my %hash = (key1=>value1=>key2=>value2=>key3=>value3=>);

CONFIGURATION ^

There is one parameter for this policy, max_allowed, which specifies the maximum number of fat arrows that may appear as item separators. The default is two. If you really hate the fat arrow, and never want to see it, you can set max_allowed to zero and make any occurance of => illegal.

Here are some examples of code that would fail with various max_allowed values:

  max_allowed    failing code
  0              (foo => bar)
  1              (foo => bar => baz)
  2              (foo => bar => baz => quux)

AUTHOR ^

Ricardo SIGNES <rjbs@cpan.org>

COPYRIGHT ^

Copyright (c) 2007 Ricardo SIGNES.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: