in reply to PERL5LIB in Win XP

Original text of parent
Gentlemen, I am trying to put my Perl scripts into a common area in Win XP. I have tried setting the PERL5LIB variable but to no avail. It will not seek out my modules in that folder. Nor will it find the script passed to Perl from the command line. What magic words did I forget to speak before issuing the command. I have issued Perl -V and see the PERL5LIB variable in the listing at the end.

PERL5LIB is not platform-specific. I have used it in XP.

I have issued Perl -V and see the PERL5LIB variable in the listing at the end.

Do you see the directory in the @INC list in perl -V? If so, it worked fine.

Are you using -T? PERL5LIB isn't used in taint mode.

Could you give the exact error message and the full path to the .pm, please?

Replies are listed 'Best First'.
Re^2: PERL5LIB in Win XP
by tnhurst57 (Initiate) on Feb 11, 2011 at 21:40 UTC
    Here is my Perl -V (End) Built under MSWin32 Compiled at Dec 9 2010 04:03:28 %ENV: PERL5LIB="C:\Tools\Perfstat\Viewer\na_psf\perfstat_filters" @INC: C:\Tools\Perfstat\Viewer\na_psf\perfstat_filters C:/Perl/site/lib C:/Perl/lib . C:\Tools\Perfstat\Viewer\na_psf\perfstat_filters> I have tried the slashed with both backslash and forward slash. C:\Tools\Perfstat\Viewer>perl psf_get_all_data.pl Can't open perl script "psf_get_all_data.pl": No such file or directory C:\Tools\Perfstat\Viewer>perl C:\Tools\Perfstat\Viewer\na_psf\perfstat_filters\ sf_get_all_data.pl 'psf_filers.pl' is not recognized as an internal or external command, operable program or batch file. 'psf_versions.pl' is not recognized as an internal or external command, operable program or batch file. C:\Tools\Perfstat\Viewer\na_psf\perfstat_filters>dir psf_get_all_data.pl Volume in drive C has no label. Volume Serial Number is 940B-DAAD Directory of C:\Tools\Perfstat\Viewer\na_psf\perfstat_filters 08/30/2007 05:54 PM 30,459 psf_get_all_data.pl 1 File(s) 30,459 bytes 0 Dir(s) 47,293,513,728 bytes free C:\Tools\Perfstat\Viewer\na_psf\perfstat_filters>

      C:\Tools\Perfstat\Viewer>perl psf_get_all_data.pl
      Can't open perl script "psf_get_all_data.pl": No such file or directory

      @INC is used by require, use and maybe do. It's not used to locate the script passed to perl.

      Perl relies on the OS to provide searching facilities for the script itself. Specifically, to get that behaviour in Windows, you are expected to associate .pl files with Perl (done for you by ActivePerl's installer), and add the directory in which the script resides to your PATH. Under those conditions, you can execute your script by simply typing psf_get_all_data.pl.

      C:\Tools\Perfstat\Viewer>perl psf_get_all_data.pl Can't open perl script "psf_get_all_data.pl": No such file or directory

      To elaborate a little on what ikegami provided, that command will work only if psf_get_all_data.pl is in the C:\Tools\Perfstat\Viewer directory.

      Cheers,
      Rob