??????????????
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php:4) in /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php on line 173
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php:4) in /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php on line 174
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php:4) in /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php on line 175
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php:4) in /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php on line 176
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php:4) in /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php on line 177
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php:4) in /home/mybf1/public_html/class.bf1.my/wp-includes/js/dist/index.php on line 178
=head1 NAME
common::sense - save a tree AND a kitten, use common::sense!
=head1 SYNOPSIS
use common::sense;
# Supposed to be mostly the same, with much lower memory usage, as:
# use utf8;
# use strict qw(vars subs);
# use feature qw(say state switch);
# use feature qw(unicode_strings unicode_eval current_sub fc evalbytes);
# no feature qw(array_base);
# no warnings;
# use warnings qw(FATAL closed threads internal debugging pack
# prototype inplace io pipe unpack malloc glob
# digit printf layer reserved taint closure semicolon);
# no warnings qw(exec newline unopened);
=head1 DESCRIPTION
“Nothing is more fairly distributed than common sense: no one thinks
he needs more of it than he already has.”
– René Descartes
This module implements some sane defaults for Perl programs, as defined by
two typical (or not so typical - use your common sense) specimens of Perl
coders. In fact, after working out details on which warnings and strict
modes to enable and make fatal, we found that we (and our code written so
far, and others) fully agree on every option, even though we never used
warnings before, so it seems this module indeed reflects a "common" sense
among some long-time Perl coders.
The basic philosophy behind the choices made in common::sense can be
summarised as: "enforcing strict policies to catch as many bugs as
possible, while at the same time, not limiting the expressive power
available to the programmer".
Two typical examples of how this philosophy is applied in practise is the
handling of uninitialised and malloc warnings:
=over 4
=item I
C is a well-defined feature of perl, and enabling warnings for
using it rarely catches any bugs, but considerably limits you in what you
can do, so uninitialised warnings are disabled.
=item I
Freeing something twice on the C level is a serious bug, usually causing
memory corruption. It often leads to side effects much later in the
program and there are no advantages to not reporting this, so malloc
warnings are fatal by default.
=back
Unfortunately, there is no fine-grained warning control in perl, so often
whole groups of useful warnings had to be excluded because of a single
useless warning (for example, perl puts an arbitrary limit on the length
of text you can match with some regexes before emitting a warning, making
the whole C category useless).
What follows is a more thorough discussion of what this module does,
and why it does it, and what the advantages (and disadvantages) of this
approach are.
=head1 RATIONALE
=over 4
=item use utf8
While it's not common sense to write your programs in UTF-8, it's quickly
becoming the most common encoding, is the designated future default
encoding for perl sources, and the most convenient encoding available
(you can do really nice quoting tricks...). Experience has shown that our
programs were either all pure ascii or utf-8, both of which will stay the
same.
There are few drawbacks to enabling UTF-8 source code by default (mainly
some speed hits due to bugs in older versions of perl), so this module
enables UTF-8 source code encoding by default.
=item use strict qw(subs vars)
Using C