in reply to Re^3: Perl syntax checking without `perl -c` (bareword)
in thread Perl syntax checking without `perl -c`

> how long that would take; how long disaster recovery would take; and, what useful coding I would not be doing while doing this instead.

yeah, that's what I meant initially, how much does one want to invest for a temporary 90% solution.

But this thread has also become an intellectual challenge and it's still possible to have a better solution.

So for completeness:

The dynamic %INC hook shown here could be extended to provide an import routine which exports all symbols requested.

This won't cover subs with special prototypes or subs which are exported by defaults though, but will get you closer to your "unreasonable" goal. ;-)

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

  • Comment on Re^4: Perl syntax checking without `perl -c` (bareword)

Replies are listed 'Best First'.
Re^5: Perl syntax checking without `perl -c` [perl lint]
by kcott (Archbishop) on Dec 06, 2020 at 02:55 UTC
    "So for completeness: ..."

    The following is somewhat negative information, but perhaps useful to know for someone coming to this thread in the future.

    I had previously done an internet search for "perl lint". I came across these two modules:

    B::Lint

    In its raw form (i.e. perl -MO=Lint file_with_perl_code) this seemed to act pretty much identically to perl -c file_with_perl_code. It does have a number of options but none turn off executing code.

    Perl::Lint

    I think this falls into the category of abandonware: not touched in over four years; about 95% of testers failed to install the module; dead link to TPF grant proposal.

    I did manage to force-install it; however, running it with my $work code produced errors (related to Perl::Lint code). I created a very simple bad.pl (with the typos I indicated above) purely as a test: although its SYNOPSIS shows running it on a bar.pl file, it complained about no package declaration; not ending with 1;; and other things which suggest the code only works on modules, not scripts.

    — Ken