Most versions of Perl have a list of directories compiled into the executable. This list is determined at configuration time. Win32 Perl used to have this but also added to this list at run time. Recent versions of Win32 Perl only compute the directories to list in @INC at run time.
Win32 Perl asks the operating system for the full path name of the its executable. It then strips off the file name (probably "perl.exe"). Then it strips of "/bin/" (and perhaps a directory name containing version information, depending on how that copy of Perl was configured when it was compiled). That gives it the base directory. Then it puts into @INC several copies of that base directory path with different subdirectories appended to it. For example, common versions of Perl for Win32 append "lib" and "site/lib" (but you could also have version-specific and/or platform-specific library subdirectories separate from those, again, depending on how that copy of perl was configured when it was compiled).
Next, some versions of Perl will look for a value in the Win32 Registry for a list of additional directories to stuff into @INC. Also, "." is put into @INC as the last entry.
Finally, all of the standard tricks kick in to add even more directories to @INC:
Note that you probably would have gotten a good answer to this question a lot sooner if you hadn't asked for a reply "asap". We are all volunteers here and do this mostly for the enjoyment of it so, whether you say "kindly" or not, asking for something "asap" just takes some of the fun out of it for many people and so reduces the odds of you getting a good answer quickly. If this seems unfair to you, I kindly offer a full refund of the purchase price. (:
- tye (but my friends call me "Tye")In reply to (tye)Re: Location of @INC in win2000
by tye
in thread Location of @INC in win2000
by athar-qadri
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |