ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/common-sense/sense.pm.PL
(Generate patch)

Comparing common-sense/sense.pm.PL (file contents):
Revision 1.6 by root, Fri Jul 2 20:43:05 2010 UTC vs.
Revision 1.7 by root, Fri Jan 14 06:46:29 2011 UTC

1#! perl 1#! perl-000
2 2
3open STDOUT, ">$ARGV[0]~" 3open STDOUT, ">$ARGV[0]~"
4 or die "$ARGV[0]~: $!"; 4 or die "$ARGV[0]~: $!";
5 5
6our $WARN; 6our $WARN;
14use utf8; 14use utf8;
15use strict qw(subs vars); 15use strict qw(subs vars);
16 16
17no warnings; 17no warnings;
18use warnings qw(FATAL closed threads internal debugging pack malloc portable prototype 18use warnings qw(FATAL closed threads internal debugging pack malloc portable prototype
19 inplace io pipe unpack regexp deprecated glob digit printf 19 inplace io pipe unpack deprecated glob digit printf
20 layer reserved taint closure semicolon); 20 layer reserved taint closure semicolon);
21no warnings qw(exec newline unopened); 21no warnings qw(exec newline unopened);
22 22
23BEGIN { 23BEGIN {
24 $H = $^H & ~$H; 24 $H = $^H & ~$H;
54 # 54 #
55 # use utf8; 55 # use utf8;
56 # use strict qw(vars subs); 56 # use strict qw(vars subs);
57 # use feature qw(say state switch); 57 # use feature qw(say state switch);
58 # no warnings; 58 # no warnings;
59 # use warnings qw(FATAL closed threads internal debugging pack malloc 59 # use warnings qw(FATAL closed threads internal debugging pack
60 # portable prototype inplace io pipe unpack regexp 60 # portable prototype inplace io pipe unpack malloc
61 # deprecated glob digit printf layer 61 # deprecated glob digit printf layer
62 # reserved taint closure semicolon); 62 # reserved taint closure semicolon);
63 # no warnings qw(exec newline unopened); 63 # no warnings qw(exec newline unopened);
64 64
65 65
101program and there are no advantages to not reporting this, so malloc 101program and there are no advantages to not reporting this, so malloc
102warnings are fatal by default. 102warnings are fatal by default.
103 103
104=back 104=back
105 105
106Unfortunately, there is no fine-grained warning control in perl, so often
107whole groups of useful warnings had to be excluded because of a single
108useless warning (for example, perl puts an arbitrary limit on the length
109of text you can match with some regexes before emitting a warning, making
110the whole C<regexp> category useless).
111
106What follows is a more thorough discussion of what this module does, 112What follows is a more thorough discussion of what this module does,
107and why it does it, and what the advantages (and disadvantages) of this 113and why it does it, and what the advantages (and disadvantages) of this
108approach are. 114approach are.
109 115
110=head1 RATIONALE 116=head1 RATIONALE
263 269
264=cut 270=cut
265 271
266package common::sense; 272package common::sense;
267 273
268our $VERSION = '3.3'; 274our $VERSION = '3.4';
269 275
270# overload should be included 276# overload should be included
271 277
272sub import { 278sub import {
273IMPORT 279IMPORT
432usefulness of some warnings over others. This module is aimed at 438usefulness of some warnings over others. This module is aimed at
433experienced Perl programmers, not people migrating from other languages 439experienced Perl programmers, not people migrating from other languages
434who might be surprised about stuff such as C<undef>. On the other hand, 440who might be surprised about stuff such as C<undef>. On the other hand,
435this does not exclude the usefulness of this module for total newbies, due 441this does not exclude the usefulness of this module for total newbies, due
436to its strictness in enforcing policy, while at the same time not limiting 442to its strictness in enforcing policy, while at the same time not limiting
437the expresive power of perl. 443the expressive power of perl.
438 444
439This module is considerably I<more> strict than the canonical C<use 445This module is considerably I<more> strict than the canonical C<use
440strict; use warnings>, as it makes all its warnings fatal in nature, so 446strict; use warnings>, as it makes all its warnings fatal in nature, so
441you can not get away with as many things as with the canonical approach. 447you can not get away with as many things as with the canonical approach.
442 448

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines