skerr1 has asked for the wisdom of the Perl Monks concerning the following question:

Hello All,

First of all: Perl=5.005_02 (I know its old), SunOS 5.6 Having some problems using the B::Lint module and have done my google searching with no good results. Here are my 2 problems:

1. I want to lint with all options except for undefined-subs. I thought this would work:
perl -MO=Lint,all,-undefined-subs foo.pl
but it just gives me the error
No such check: _undefined_subs
I have been able to do this by including all of the Lint options that I want on in my Perl command.
perl -MO=Lint,context,implicit-read,implicit-write,dollar-underscore,private-names,regexp-variables foo.pl
So, I must be doing something wrong here.

2. My second issue, is that because I am using autoloaded functions in my Perl module bar.pm, I want to include my bar package in the linting process by using the -u Package non-lint option. So I tried:
perl -MO=Lint,all,-ubar (and -u bar, -ubar.pm, -u bar.pm also tried without the ",all")
Unless my subs are Lint free (I put lint warnings in one), its not working as I expected.
I used lint to check bar.pm alone with
perl -MO=Lint,all bar.pm
and it did pick up an error in main but I don't think that it checked the subs.

Anyway, this is what I have. I hope someone out there can give me some better direction on these.

Thanks, Shannon

Replies are listed 'Best First'.
Re: B::Lint Usage Problems
by demerphq (Chancellor) on Aug 15, 2002 at 16:49 UTC
    Re:
    perl -MO=Lint,all,-undefined-subs foo.pl
    I dont know about your version but the 5.6 version says that that should be
    perl -MO=Lint,-all,-no-undefined-subs foo.pl
    However I am unconvinced that Lint will catch undefined subs.

    The -u issue I cant help you with. :-) Sorry.

    HTH

    Yves / DeMerphq
    ---
    Software Engineering is Programming when you can't. -- E. W. Dijkstra (RIP)

Re: B::Lint Usage Problems
by skerr1 (Sexton) on Aug 15, 2002 at 16:31 UTC
    Forgot one question:

    Why do I see lint warnings with File::Copy and File::Path but I don't see any warnings for my own personal module (bar.pm)? According to the B::Lint manpage (see the -u option) "Normally, Lint only checks the main code of the program together with all subs defined in package main." So, I wouldn't expect any warnings on File::Copy and File::Path, or I would expect warnings for all modules, right??

    Thanks - Shannon
      It might be because File::Copy and File::Path export subroutines that then are also in the main:: package, but that's just a guess as I've never used B::Lint.

      Hope that explains a bit,
      Joost.

      -- Joost downtime n. The period during which a system is error-free and immune from user input.