1 ##############################################################################
2 # $URL: http://perlcritic.tigris.org/svn/perlcritic/trunk/Perl-Critic/lib/Perl/Critic/Policy/Miscellanea/ProhibitFormats.pm $
3 # $Date: 2008-07-03 10:19:10 -0500 (Thu, 03 Jul 2008) $
6 ##############################################################################
8 package Perl::Critic::Policy::Miscellanea::ProhibitFormats;
15 use Perl::Critic::Utils qw{ :severities :classification };
16 use base 'Perl::Critic::Policy';
18 our $VERSION = '1.088';
20 #-----------------------------------------------------------------------------
22 Readonly::Scalar my $DESC => q{Format used};
23 Readonly::Scalar my $EXPL => [ 449 ];
25 #-----------------------------------------------------------------------------
27 sub supported_parameters { return () }
28 sub default_severity { return $SEVERITY_MEDIUM }
29 sub default_themes { return qw( core maintenance pbp ) }
30 sub applies_to { return 'PPI::Token::Word' }
32 #-----------------------------------------------------------------------------
35 my ( $self, $elem, undef ) = @_;
36 return if $elem ne 'format';
37 return if ! is_function_call( $elem );
38 return $self->violation( $DESC, $EXPL, $elem );
46 #-----------------------------------------------------------------------------
52 Perl::Critic::Policy::Miscellanea::ProhibitFormats - Do not use C<format>.
56 This Policy is part of the core L<Perl::Critic> distribution.
61 Formats are one of the oldest features of Perl. Unfortunately, they suffer
62 from several limitations. Formats are static and cannot be easily defined
63 at run time. Also, formats depend on several obscure global variables.
65 For more modern reporting tools, consider using one of the template frameworks
66 like L<Template> or try the L<Perl6::Form> module.
71 This Policy is not configurable except for the standard options.
76 Jeffrey Ryan Thalhammer <thaljef@cpan.org>
80 Copyright (c) 2005-2008 Jeffrey Ryan Thalhammer. All rights reserved.
82 This program is free software; you can redistribute it and/or modify
83 it under the same terms as Perl itself. The full text of this license
84 can be found in the LICENSE file included with this module.
90 # cperl-indent-level: 4
92 # indent-tabs-mode: nil
93 # c-indentation-style: bsd
95 # ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :