Perl::Critic::Policy::Variables::ProhibitPunctuationVars - Write $EVAL_ERROR instead of $@.
$EVAL_ERROR
$@
This Policy is part of the core Perl::Critic distribution.
Perl's vocabulary of punctuation variables such as $!, $., and $^ are perhaps the leading cause of its reputation as inscrutable line noise. The simple alternative is to use the English module to give them clear names.
$!
$.
$^
$| = undef; #not ok use English qw(-no_match_vars); local $OUTPUT_AUTOFLUSH = undef; #ok
The scratch variables $_ and @_ are very common and are pretty well understood, so they are exempt from this policy. The same goes for the less-frequently-used default filehandle _ used by stat(). All the regexp capture variables ($1, $2, ...) are exempt too.
$_
@_
_
$1
$2
You can add more exceptions to your configuration. In your perlcriticrc file, add a block like this:
[Variables::ProhibitPunctuationVars] allow = $@ $!
The allow property should be a whitespace-delimited list of punctuation variables.
allow
This doesn't find punctuation variables in strings.
Jeffrey Ryan Thalhammer <thaljef@cpan.org>
Copyright (c) 2005-2008 Jeffrey Ryan Thalhammer. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license can be found in the LICENSE file included with this module.
To install Perl::Critic, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Perl::Critic
CPAN shell
perl -MCPAN -e shell install Perl::Critic
For more information on module installation, please visit the detailed CPAN module installation guide.