Antwort: RE: [Perl-unix-users] Using variables in a library path

2006-03-01 Thread Georg . Mavridis
Hi Peter, > > push @INC, "$BASE_PATH/scripts/common"; > > Doesn't this only work within a BEGIN {} block? No this works outside of beginblocks too -- but as use "statements" are executed at the same time with BEGIN {} blocks this statement wont affect them. (But it would be usefull to the requi

RE: [Perl-unix-users] Using variables in a library path

2006-03-01 Thread Peter Eisengrein
> push @INC, "$BASE_PATH/scripts/common"; Doesn't this only work within a BEGIN {} block? ___ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Antwort: [Perl-unix-users] Using variables in a library path

2006-02-28 Thread Georg . Mavridis
Hi Vladimir, This code Our $BASE_PATH = '\web_test\'; Use lib $BASE_PATH.'scripts\common\'; Require 'header.pl'; can't work as use "statements" are executed by perl before of the rest of the code. The most common way 2 solve this problem is 2 use constants: use constant BASE_PATH => '\web_te

Re: [Perl-unix-users] Using variables in a library path

2006-02-28 Thread $Bill Luebkert
Makarov, Vladimir/Medical Library wrote: > > Hello, > > I am trying to trivial things (I think): > Instead of using > > Use lib '\web_test\scripts\common\'; > Require 'header.pl'; Case is relevent in Perl and \s aren't portable, so use /s whenever possible. The \' is invalid syntax at the end

Re: [Perl-unix-users] Using variables in a library path

2006-02-28 Thread Anthony Ettinger
try this: my $lib = $base . "/path/to/libs"; use lib qw($lib); I read something about loading dynamic library paths at runtime though was not a good idea. On 2/28/06, Makarov, Vladimir/Medical Library <[EMAIL PROTECTED]> wrote: > > > Hello, > > I am trying to trivial things (I think): > Instead

[Perl-unix-users] Using variables in a library path

2006-02-28 Thread Makarov, Vladimir/Medical Library
Hello, I am trying to trivial things (I think): Instead of using Use lib '\web_test\scripts\common\'; Require 'header.pl'; For portability reason (I have also "web_production"), I tried to assign a scalar varible to the part of the path, such as Our $BASE_PATH = '\web_test\'; Use lib $BASE_P