Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: Perl syntax checking without `perl -c`

by Fletch (Chancellor)
on Dec 03, 2020 at 14:58 UTC ( #11124585=note: print w/replies, xml ) Need Help??


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 (Cardinal) 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...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11124585]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2021-04-11 21:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?