Name : perl-warnings-pedantic
| |
Version : 0.02
| Vendor : obs://build_opensuse_org/devel:languages:perl
|
Release : 4.17
| Date : 2017-08-04 17:26:45
|
Group : Development/Libraries/Perl
| Source RPM : perl-warnings-pedantic-0.02-4.17.src.rpm
|
Size : 0.02 MB
| |
Packager : (none)
| |
Summary : Dubious warnings for dubious constructs
|
Description :
Besides the \'pedantic\' category, which enables all of the following, the module also provides separate categories for individual groups of warnings:
* * void_grep
Warns on void-context \'grep\':
grep /42/, AATTINC; grep { /42/ } AATTINC;
This code is not particularly wrong; it\'s merely using grep as an alternative to a foreach loop.
* * void_close
Warns on void-context \'close()\' and \'closedir()\':
close($fh); closedir($dirh);
This is considered dubious behaviour because errors on IO operations, such as ENOSPC, are not usually caught on the operation itself, but on the close() of the related filehandle.
* * void_print
Warns on void-context print(), printf(), and say():
print(); say(); printf();
* * sort_prototype
Warns when \'sort()\'\'s first argument is a subroutine with a prototype, and that prototype isn\'t \'$$\'.
sub takes_a_block (&AATT) { ... } takes_a_block { stuff_here } AATTargs; sort takes_a_block sub {...}, AATTargs;
This probably doesn\'t do what the author intended for it to do.
* * ref_assignment
Warns when you attempt to assign an arrayref to an array, without using parenthesis to disambiguate:
my AATTa = [1,2,3]; # Warns; did you mean (...) instead of [...]? my AATTa2 = ([1,2,3]); # Doesn\'t warn
This is a common mistake for people who\'ve recently picked up Perl.
* * maybe_const
Identifiers used as either hash keys or on the left hand side of the fat comma are always interpreted as barewords, even if they have a constant attached to that name:
use constant CONSTANT => 1; my %x = CONSTANT => 5; # Used as \"CONSTANT\" $x{CONSTANT} = 5; # Ditto
This is intended behaviour on Perl\'s part, but is an occasional source of bugs.
Or in tree form:
all -+ | +- pedantic --+ | +- void_grep | +- void_close | +- void_print | +- sort_prototype | +- ref_assignment | +- maybe_const
All of the warnings can be turned off with
no warnings \'pedantic\';
as well as
no warnings;
or even
no warnings::pedantic;
Additionally, you can turn off specific warnings with
no warnings \'void_grep\'; no warnings \'void_close\'; no warnings \'void_print\'; # printf, print, and say
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl:/CPAN-W/openSUSE_Tumbleweed/x86_64 |