Manual Pages for UNIX Darwin command on man B::Lint
MyWebUniversity

Manual Pages for UNIX Darwin command on man B::Lint

B::Lint(3pm) Perl Programmers Reference Guide B::Lint(3pm)

NAME

B::Lint - Perl lint

SYNOPSIS

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

DESCRIPTION

The B::Lint module is equivalent to an extended version of the -ww

option of ppeerrll. It is named after the program lint which carries out a similar process for C programs. OOPPTTIIOONNSS AANNDD LLIINNTT CCHHEECCKKSS 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 argu-

ment (apart from the special aallll and nnoonnee options) is a word represent-

ing one possible lint check (turning on that check) or is nnoo-ffoooo (turn-

ing off that check). Before processing the check arguments, a standard list of checks is turned on. Later options override earlier ones. Available options are: ccoonntteexxtt Produces a warning whenever an array is used in an implicit scalar context. For example, both of the lines

$foo = length(@bar);

$foo = @bar;

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

$foo = scalar(@bar);

iimmpplliicciitt-rreeaadd and iimmpplliicciitt-wwrriittee

These options produce a warning whenever an operation implic-

itly reads or (respectively) writes to one of Perl's special

variables. For example, iimmpplliicciitt-rreeaadd will warn about these:

/foo/;

and iimmpplliicciitt-wwrriittee will warn about these:

s/foo/bar/;

Both iimmpplliicciitt-rreeaadd and iimmpplliicciitt-wwrriittee warn about this:

for (@a) { ... }

bbaarree-ssuubbss

This option warns whenever a bareword is implicitly quoted, but

is also the name of a subroutine in the current package. Typi-

cal mistakes that it will trap are: use constant foo => 'bar'; @a = ( foo => 1 );

$b{foo} = 2;

Neither of these will do what a naive user would expect.

ddoollllaarr-uunnddeerrssccoorree

This option warns whenever $ is used either explicitly any-

where or as the implicit argument of a pprriinntt statement.

pprriivvaattee-nnaammeess

This option warns on each use of any variable, subroutine or

method name that lives in a non-current package but begins with

an underscore (""). Warnings aren't issued for the special

case of the single character name "" by itself (e.g. $ and

@).

uunnddeeffiinneedd-ssuubbss

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 defi-

nition of subs until runtime by means of the AUTOLOAD mecha-

nism.

rreeggeexxpp-vvaarriiaabblleess

This option warns whenever one of the regexp variables $`, $&

or $' is used. Any occurrence of any of these variables in your

program can slow your whole program down. See perlre for details. aallll Turn all warnings on. nnoonnee Turn all warnings off.

NNOONN LLIINNTT-CCHHEECCKK OOPPTTIIOONNSS

-uu PPaacckkaaggee

Normally, Lint only checks the main code of the program

together with all subs defined in package main. The -uu option

lets you include other package names whose subs are then checked by Lint.

BUGS

This is only a very preliminary version.

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

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

perl v5.8.8 2001-09-21 B::Lint(3pm)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™