Re: How does perl know it's environment.
From: Alan Stewart (astewart1_at_cox.net)
Date: 07/16/04
- Next message: Dylan Reinhold: "Sort Part of a string"
- Previous message: Joe Smith: "Re: How does perl know it's environment."
- In reply to: Juha Laiho: "Re: How does perl know it's environment."
- Next in thread: Joe Smith: "Re: How does perl know it's environment."
- Reply: Joe Smith: "Re: How does perl know it's environment."
- Reply: Juha Laiho: "Re: How does perl know it's environment."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 16 Jul 2004 00:40:36 -0700
On Thu, 15 Jul 2004 13:22:02 GMT, Juha Laiho <Juha.Laiho@iki.fi>
wrote:
>Alan Stewart <astewart1@cox.net> said:
>>On Mon, 12 Jul 2004 15:43:27 -0500, TLOlczyk <olczyk2002@yahoo.com>
>>wrote:
>>>I've scoured the documentation and have not been able to find
>>>an an answer to the following question.
>>>
>>>Assuming there are no environmental variables set specifically
>>>for perl. How does perl know where to find it's installed
>>>packages, where to install packages, location of the library etc.
>...
>>Since this thread seems to have offered mostly English lessons or
>>mis-information, I'll offer an answer.
>
>But yet another false one - on Unix, at least.
>
>>It doesn't have paths built into the binary and it doesn't use the
>>Win32 registry.
>
>"ldd /usr/bin/perl" gives:
> libperl.so => /usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so (0x40017000)
>(among other libraries -- and no, that path doesn't change just by copying
>/usr/bin/perl somewhere else; it's hardcoded into the binary)
I assume that if you just copied /usr/bin/perl somewhere, that it
found libperl.so in LD_LIBRARY_PATH, not from something built into
/usr/bin/perl
What I suggested was copying both /usr/bin/perl AND libperl.so
somwhere. And you probably need to change LD_LIBRARY_PATH to point
there temporarily to do that. In Windows, I just let it find the lib
in "." first without modifying PATH.
I don't have Unix, so I don't know if it's true there or not. I am
just inferring from reading the doc on ldd. What do you see if you
move both and try "perl -V"?
>
>Further, a search through the above shared library file finds:
What kind of search?
>/usr/lib/perl5/5.8.0
>/usr/lib/perl5/site_perl
>/usr/lib/perl5/vendor_perl
>/usr/lib/perl5/5.8.0/i386-linux-thread-multi
>/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
>/usr/lib/perl5/site_perl/5.8.0
>/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
>/usr/lib/perl5/vendor_perl/5.8.0
>
>... which very much looks like the initial @INC contents.
>
>In Windows it could well be that some locations can be determined by
>the installation location of the actual binary file;
See the example in my reply to Jonathan. At least Windows can. I
always assume that Unix can do at least as much :)
> in Unix side it's
>pretty much impossible to even find out where the "currently running"
>executable is located in the directory hierarchy (especially given the
>facts that a single file may have multiple directory entries in various
>places across the directory structure, and that the file might not have
>_any_ directory entry by the time it tries to determine from where it was
>run).
I would expect the OS knows which of many possible paths it used to
fetch an executable file, even if it is not readily determined by an
application programmer. Again, I am only inferring from the Windows
example. A perl program may get misleading info as to the path of the
perl script, but Windows certainly knows where the perlxx.dll came
from and that is available inside the dll code.
Alan
- Next message: Dylan Reinhold: "Sort Part of a string"
- Previous message: Joe Smith: "Re: How does perl know it's environment."
- In reply to: Juha Laiho: "Re: How does perl know it's environment."
- Next in thread: Joe Smith: "Re: How does perl know it's environment."
- Reply: Joe Smith: "Re: How does perl know it's environment."
- Reply: Juha Laiho: "Re: How does perl know it's environment."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|