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 of the use lib.  You need to double the
last \ to \\ if you insist on using \s or removing it would be better yet.

        use lib '\web_test\scripts\common';     # should work
        use lib '/web_test/scripts/common';     # better
        require 'header.pl';

Generally, I never use a \ or / at the of a path - it problematic and makes it
harder to do stuff like :

        my $newpath = "$path/$file";  # better to add the / yourself when 
needed like this

> 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_PATH.'scripts\common\';
> Require 'header.pl';

Try:

our $BASE_PATH = '/web_test';
push @INC, "$BASE_PATH/scripts/common";
require 'header.pl';

> First way works just fine, but second does not. I have a "use of
> uninitiolized variable in string concatination" error messge. Does any
> one knows the reason? I believe that $BASE_PATH was initialized
> properly.
_______________________________________________
Perl-Unix-Users mailing list
Perl-Unix-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to