Can anyone tell me why this code fails when trying to load
Some_Module_In_lib_Dir-
==============================
my $file_path =
substr($ENV{SCRIPT_FILENAME},0,index($ENV{SCRIPT_FILENAME},'/test.cgi'));
use lib "$file_path/../lib";
use Some_Module_In_lib_Dir;

==============================
And this code does not -
==============================
use FindBin qw($Bin);
use lib "$Bin/../lib";
use Some_Module_In_lib_Dir;

==============================
And this code does not -
==============================
use lib '/home/user/domain-www/cgi-bin/some_dir/test/../lib'
use Some_Module_In_lib_Dir;

==============================
And this code does not -
==============================
use lib
substr($ENV{SCRIPT_FILENAME},0,index($ENV{SCRIPT_FILENAME},'/test.cgi')) .
"/../lib";
use Some_Module_In_lib_Dir;


If $Bin and $file_path are printed to screen, they show values identical to
the path used in the third example and that one derived in the fourth
example. So, why does $Bin get added to @INC before the program tries to
load Some_Module_In_lib_Dir, and $file_path does not?


Up On The Mountain Design Group

Custom solutions for your database driven web site.


Ron Goral
[EMAIL PROTECTED]
Tel  1 (920) 356 0239
Fax  1 (928) 752 6629
www.uponthemountain.com



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to