petr999 has asked for the wisdom of the Perl Monks concerning the following question:
Hello,
I run a perl binary with a perl interpreter from my perl program with system.
Both perl binary I run with system and my perl program that runs it require the library (module) for inclusion. The 'parent' perl source gets it with perl's -I flag. I assume it is always 'all right' and my module is always found.
What I want is to pass that -I flag to the 'child' program as it is/they are specified for the 'parent' program.
I think to formulate this task as 'to get all of the flags supplied for the current Perl interpreter' should be okay as I can get the matching qr{^-I} flags then.
The problem is: how can I get my Perl's interpreter's runtime flags? perlvar was no much help to me. Where should this info be found?
In details, I'd like to test my bin/stuff run from my t/555-test.t. By far the test will be supplied the '-I' flags from both 'prove' and 'make test' as well as need no the '-I' flags after being installed so I'd like to have my '-I' flag for my Perl interpreter to run it in the system() exactly the same as for my test being performed.
Can this be done?
Thank you.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Know a perl's -I flag from perl?
by tobyink (Canon) on Dec 15, 2012 at 11:10 UTC | |
by petr999 (Acolyte) on Dec 15, 2012 at 12:00 UTC | |
|
Re: Know a perl's -I flag from perl?
by Anonymous Monk on Dec 15, 2012 at 10:45 UTC | |
by petr999 (Acolyte) on Dec 15, 2012 at 14:27 UTC | |
by Anonymous Monk on Dec 16, 2012 at 00:21 UTC | |
by tobyink (Canon) on Dec 19, 2012 at 14:58 UTC | |
by Anonymous Monk on Dec 21, 2012 at 03:59 UTC |