MirOS Manual: B::Lint(3p)

ext::B::B::Lint(3Perl Programmers Reference Guext::B::B::Lint(3p)


     B::Lint - Perl lint


     perl -MO=Lint[,OPTIONS] foo.pl


     The B::Lint module is equivalent to an extended version of
     the -w option of perl. It is named after the program lint
     which carries out a similar process for C programs.


     Option words are separated by commas (not whitespace) and
     follow the usual conventions of compiler backend options.
     Following any options (indicated by a leading -) come lint
     check arguments. Each such argument (apart from the special
     all and none options) is a word representing one possible
     lint check (turning on that check) or is no-foo (turning off
     that check). Before processing the check arguments, a stan-
     dard list of checks is turned on. Later options override
     earlier ones. Available options are:

     context Produces a warning whenever an array is used in an
             implicit scalar context. For example, both of the

                 $foo = length(@bar);
                 $foo = @bar;

             will elicit a warning. Using an explicit scalar()
             silences the warning. For example,

                 $foo = scalar(@bar);

     implicit-read and implicit-write
             These options produce a warning whenever an opera-
             tion implicitly reads or (respectively) writes to
             one of Perl's special variables. For example,
             implicit-read will warn about these:


             and implicit-write will warn about these:


             Both implicit-read and implicit-write warn about

                 for (@a) { ... }


perl v5.8.8                2005-02-05                           1

ext::B::B::Lint(3Perl Programmers Reference Guext::B::B::Lint(3p)

             This option warns whenever a bareword is implicitly
             quoted, but is also the name of a subroutine in the
             current package. Typical mistakes that it will trap

                 use constant foo => 'bar';
                 @a = ( foo => 1 );
                 $b{foo} = 2;

             Neither of these will do what a naive user would

             This option warns whenever $_ is used either expli-
             citly anywhere or as the implicit argument of a
             print statement.

             This option warns on each use of any variable, sub-
             routine or method name that lives in a non-current
             package but begins with an underscore ("_"). Warn-
             ings aren't issued for the special case of the sin-
             gle character name "_" by itself (e.g. $_ and @_).

             This option warns whenever an undefined subroutine
             is invoked. This option will only catch explicitly
             invoked subroutines such as "foo()" and not indirect
             invocations such as "&$subref()" or "$obj->meth()".
             Note that some programs or modules delay definition
             of subs until runtime by means of the AUTOLOAD

             This option warns whenever one of the regexp vari-
             ables $`, $& or $' is used. Any occurrence of any of
             these variables in your program can slow your whole
             program down. See perlre for details.

     all     Turn all warnings on.

     none    Turn all warnings off.

     -u Package
             Normally, Lint only checks the main code of the pro-
             gram together with all subs defined in package main.
             The -u option lets you include other package names
             whose subs are then checked by Lint.


     This is only a very preliminary version.

perl v5.8.8                2005-02-05                           2

ext::B::B::Lint(3Perl Programmers Reference Guext::B::B::Lint(3p)

     This module doesn't work correctly on thread-enabled perls.


     Malcolm Beattie, mbeattie@sable.ox.ac.uk.

perl v5.8.8                2005-02-05                           3

Generated on 2015-07-19 22:36:15 by $MirOS: src/scripts/roff2htm,v 1.80 2015/01/02 13:54:19 tg Exp $

These manual pages and other documentation are copyrighted by their respective writers; their source is available at our CVSweb, AnonCVS, and other mirrors. The rest is Copyright © 2002–2015 The MirOS Project, Germany.
This product includes material provided by Thorsten Glaser.

This manual page’s HTML representation is supposed to be valid XHTML/1.1; if not, please send a bug report – diffs preferred.