in reply to Perl syntax checking without `perl -c`

Thanks and ++ to everyone who responded; there were a lot of posts and I won't be replying individually.

I tried variations on some of the fake module suggestions. After faking multiple modules, I finally got rid of the "Can't locate SomeMod.pm in @INC ..." messages; however, I then started getting messages like "Can't use bareword ("syntactic_sugar") ...".

There were a lot of interesting takes on that general principle; and even a movie (thanks Dave). I'll keep these in mind: they may be useful at some later time but, unfortunately, not at the present.

It looks like disaster recovery is moving along nicely: hopefully, I'll be back to normal operations early next week.

— Ken

Replies are listed 'Best First'.
Re^2: Perl syntax checking without `perl -c` (bareword)
by LanX (Saint) on Dec 04, 2020 at 12:02 UTC
      "Hence you'll need to fake-export them too. ;)"

      Yes, I was aware of that and even considered doing it. The main criteria, when thinking about doing that, were: how long that would take; how long disaster recovery would take; and, what useful coding I would not be doing while doing this instead.

      I tend not to make too many mistakes. Mostly they involve keyboard errors: not pressing or releasing the shift key fast enough; hitting an adjacent key by mistake; and the like. E.g.

      my @x = qw{a b c}: # slow release of shift: got ':' instead of ';' my $y - $x[2]; # hit adjacent key: got '-' instead of '='

      Thankfully these are pretty rare and easily fixed.

      Other types of errors, such as logic errors, are not syntax errors and are only found when testing.

      — Ken

        > 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