Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Removing entries from @INC

by perlancar (Hermit)
on Feb 25, 2022 at 01:19 UTC ( #11141630=note: print w/replies, xml ) Need Help??


in reply to Re: Removing entries from @INC
in thread Removing entries from @INC

I have a perl script that starts another instance of perl interpreter, and I want the latter to inherit the original script's @INC.

The actual case is I'm testing (prove -l) a script in a Perl distribution which starts another perl script that requires a module in the current distribution. The latter script would fail to find the module because its @INC does not contain lib. Now in this specific case I can just add -Ilib option to the latter script's invocation when detecting some environment variable, but I'm curious about the more generic solution.

Replies are listed 'Best First'.
Re^3: Removing entries from @INC
by ikegami (Patriarch) on Feb 25, 2022 at 15:16 UTC

    Have script #1 add to PERL5LIB whatever it adds to @INC.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2023-12-06 17:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (31 votes). Check out past polls.

    Notices?