develooper Front page | perl.perl5.porters | Postings from April 2014

[perl #121648] Syntax check which ignores 'use' directives

From:
Ricardo SIGNES via RT
Date:
April 22, 2014 13:08
Subject:
[perl #121648] Syntax check which ignores 'use' directives
Message ID:
rt-4.0.18-4370-1398172103-193.121648-15-0@perl.org
This should be do-able with an @INC hook.  Check the documentation for `require` (in perlfunc) and look for the section beginning:

    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.

With this feature, you should be able add a coderef to the very end of @INC, which just returns "1" for anything not found before that.

I think you will find this less useful than you predict, but you can code it up and find out easily enough!

At any rate, this feature can be written outside of the core, and its inclusion in core discussed when it has proven indispensable. 

-- 
rjbs

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=121648



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About