|
NAMEPerl::Critic::Policy::BuiltinFunctions::ProhibitShiftRef - Prohibit "\shift" in codeAFFILIATIONThis Policy is part of the core Perl::Critic distribution.DESCRIPTIONProhibit the use of "\shift", as it is associated with bugs in Perl and its modules.BackgroundOften, "\shift" is used to create references that act much like an alias. By creating an "alias" that is named, the code becomes more readable. For example,sub routine { my $longstring = \shift; print $$longstring; } is more readable than sub routine { print $_[0]; # longstring } Unfortunately, this added readability brings with it new and exciting issues, detailed in the next section. Problems with "\shift"By avoiding "\shift", several issues in Perl can be averted, including:
CONFIGURATIONThis Policy is not configurable except for the standard options.SEE ALSO<https://rt.perl.org/Public/Bug/Display.html?id=126676><https://github.com/pjcj/Devel--Cover/issues/125> AUTHORChris Lindee <chris.lindee@cpanel.net>COPYRIGHTCopyright (c) 2018 cPanel, L.L.C.All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Visit the GSP FreeBSD Man Page Interface. |