Modified source files and compiled any and armel versions of packages
[pkg-perl] / deb-src / libperl-critic-perl / libperl-critic-perl-1.088 / lib / Perl / Critic / Policy / Miscellanea / ProhibitTies.pm
1 ##############################################################################
2 #      $URL: http://perlcritic.tigris.org/svn/perlcritic/trunk/Perl-Critic/lib/Perl/Critic/Policy/Miscellanea/ProhibitTies.pm $
3 #     $Date: 2008-07-03 10:19:10 -0500 (Thu, 03 Jul 2008) $
4 #   $Author: clonezone $
5 # $Revision: 2489 $
6 ##############################################################################
7
8 package Perl::Critic::Policy::Miscellanea::ProhibitTies;
9
10 use 5.006001;
11 use strict;
12 use warnings;
13 use Readonly;
14
15 use Perl::Critic::Utils qw{ :severities :classification };
16 use base 'Perl::Critic::Policy';
17
18 our $VERSION = '1.088';
19
20 #-----------------------------------------------------------------------------
21
22 Readonly::Scalar my $DESC => q{Tied variable used};
23 Readonly::Scalar my $EXPL => [ 451 ];
24
25 #-----------------------------------------------------------------------------
26
27 sub supported_parameters { return ()                       }
28 sub default_severity     { return $SEVERITY_LOW            }
29 sub default_themes       { return qw(core pbp maintenance) }
30 sub applies_to           { return 'PPI::Token::Word'       }
31
32 #-----------------------------------------------------------------------------
33
34 sub violates {
35     my ( $self, $elem, undef ) = @_;
36     return if $elem ne 'tie';
37     return if ! is_function_call( $elem );
38     return $self->violation( $DESC, $EXPL, $elem );
39 }
40
41
42 1;
43
44 __END__
45
46 #-----------------------------------------------------------------------------
47
48 =pod
49
50 =head1 NAME
51
52 Perl::Critic::Policy::Miscellanea::ProhibitTies - Do not use C<tie>.
53
54 =head1 AFFILIATION
55
56 This Policy is part of the core L<Perl::Critic> distribution.
57
58
59 =head1 DESCRIPTION
60
61 Conway discourages using C<tie> to bind Perl primitive variables to
62 user-defined objects.  Unless the tie is done close to where the
63 object is used, other developers probably won't know that the variable
64 has special behavior.  If you want to encapsulate complex behavior,
65 just use a proper object or subroutine.
66
67
68 =head1 CONFIGURATION
69
70 This Policy is not configurable except for the standard options.
71
72
73 =head1 AUTHOR
74
75 Jeffrey Ryan Thalhammer <thaljef@cpan.org>
76
77 =head1 COPYRIGHT
78
79 Copyright (c) 2005-2008 Jeffrey Ryan Thalhammer.  All rights reserved.
80
81 This program is free software; you can redistribute it and/or modify
82 it under the same terms as Perl itself.  The full text of this license
83 can be found in the LICENSE file included with this module.
84
85 =cut
86
87 # Local Variables:
88 #   mode: cperl
89 #   cperl-indent-level: 4
90 #   fill-column: 78
91 #   indent-tabs-mode: nil
92 #   c-indentation-style: bsd
93 # End:
94 # ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :