[svn:perlfaq] r11019 - perlfaq/trunk
[email protected] Sat, 29 Mar 2008 17:55:22 -0700 (PDT)
| Newsgroups | perl.cvs.perlfaq |
|---|---|
| Message-ID | <[email protected]> |
Author: comdog
Date: Sat Mar 29 17:55:22 2008
New Revision: 11019
Modified:
perlfaq/trunk/perlfaq8.pod
Log:
* perlfaq8: How do I add the directory my program lives in to the module/library search path?
+ FindBin does not search PATH, so don't say that it does
Modified: perlfaq/trunk/perlfaq8.pod
==============================================================================
--- perlfaq/trunk/perlfaq8.pod (original)
+++ perlfaq/trunk/perlfaq8.pod Sat Mar 29 17:55:22 2008
@@ -1273,13 +1273,11 @@
use lib $directory;
-The C<FindBin> module, which comes with Perl, might work. It searches
-through C<$ENV{PATH}> (so your script has to be in one of those
-directories). You can then use that directory (in C<$FindBin::Bin>)
-to locate nearby directories you want to add:
+The C<FindBin> module, which comes with Perl, might work. It finds the
+directory of the currently running script and puts it in C<$Bin>, which
+you can then use to construct the right library path:
- use FindBin;
- use lib "$FindBin::Bin/../lib";
+ use FindBin qw($Bin);
=head2 How do I add a directory to my include path (@INC) at runtime?