in reply to Re^2: Doubt in Eval
in thread Doubt in Eval

Common sense is to use strict and warnings.

Replies are listed 'Best First'.
Re^4: Doubt in Eval
by Anonymous Monk on Feb 17, 2012 at 03:45 UTC
    perldoc common::sense NAME common::sense - save a tree AND a kitten, use common::sense! SYNOPSIS use common::sense; # supposed to be the same, with much lower memory usage, as: # # use utf8; # use strict qw(vars subs); # use feature qw(say state switch); # no warnings; # use warnings qw(FATAL closed threads internal debugging pack # portable prototype inplace io pipe unpack mallo +c # deprecated glob digit printf layer # reserved taint closure semicolon); # no warnings qw(exec newline unopened);
      I know what common::sense is, but I argue that one should use common sense (without double colon)

        Yes, it can be made to work without the double colon. ;-)

        lib/common.pm:

        package common; require common::sense; *import = sub { $code = common::sense->can('import') and goto $code }

        example.pl:

        use common sense; print $foo;

        Output:

        [tai@miranda (pts/0) ~]$ perl -Ilib example.pl Global symbol "$foo" requires explicit package name at example.pl line + 2. Execution of example.pl aborted due to compilation errors.