in reply to Re^2: Perl syntax checking without `perl -c`
in thread Perl syntax checking without `perl -c`

Seconded; I've used basically the same thing letting flycheck run on my desktop working copy at $work so that it's perl -c check behaves even though I don't have the same perl environment available as the production machines where the code actually runs.

The cake is a lie.
The cake is a lie.
The cake is a lie.

Replies are listed 'Best First'.
Re^4: Perl syntax checking without `perl -c`
by LanX (Saint) on Dec 03, 2020 at 15:15 UTC
    The problem I see with this filesystem approach is maintenance.

    What if a missing module was installed in the meantime?

    A module "FakeInc" called via something like perl -MFakeInc -c could check if the module is available before installing a facade.

    ~~~

    Thinking about it, having a code hook at the last position of @INC could also handle all missing modules...

    from require : You can also insert hooks into the import facility by putting Perl code directly into the @INC array. There are three forms of hooks: subroutine references, array references, and blessed objects.

    update

    oops ... I didn't realized there was already a demo: Re: Perl syntax checking without `perl -c`

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

      "from require : You can also insert hooks into the import facility by putting Perl code directly into the @INC array. There are three forms of hooks: subroutine references, array references, and blessed objects."

      Well I'll be damned. All my years of Perl, and I've never known this. Man, I've been in several situations where this would have been handy. Off to play around...