Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

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

by LanX (Saint)
on Dec 03, 2020 at 15:15 UTC ( [id://11124586]=note: print w/replies, xml ) Need Help??


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

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

Replies are listed 'Best First'.
Re^5: Perl syntax checking without `perl -c`
by stevieb (Canon) on Dec 05, 2020 at 17:00 UTC
    "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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11124586]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2024-04-24 18:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found