
perlfarmer
User
Nov 5, 2009, 10:02 AM
Post #6 of 6
(380 views)
|
Hmm. When I put the use lib statement inside the block a later require statement, that looks for something in that lib, fails. The only thing that seems to work is:
my $CEToolsPath; BEGIN { $CEToolsPath = "/vbs/tools/cetools"; if (-d "/vbs/tools/cetools") { $CEToolsPath = "/vbs/tools/cetools"; } else { $CEToolsPath = "/wsdb/tools.out/cetools"; } } use lib "$CEToolsPath/perllib"; which is fine, but it doesn't fit with my understanding of how BEGIN works.
|