in reply to Problems with 'use lib'
The "use lib" action is done at compile time, before statements like
can be executed to set the variable. You need to force your value to be defined during compilation. Perhaps this might be more like what you were thinking?my $projectLocation = '/some/other/place';
But then this gets back to something like the starting question - where does the value for $projectLocation come from? Ah, an environment variable. So maybeBEGIN { my $projectLocation = '/some/other/place'; use lib $projectLocation; }
will do what you want.BEGIN { use lib $ENV{MYLIBRARYDIR}; printf "in BEGIN: '%s'\n", join("', '", @INC ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Problems with 'use lib'
by esh (Pilgrim) on Aug 21, 2003 at 07:38 UTC | |
by shenme (Priest) on Aug 21, 2003 at 18:02 UTC |