Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: path for perl

by Anonymous Monk
on Feb 20, 2009 at 07:30 UTC ( [id://745296]=note: print w/replies, xml ) Need Help??


in reply to path for perl

Once I have set path=C:\perl\bin , in environment variable, do I need to set any other path ?
Like you were already told, setting path to C:\perl\bin was a mistake. %PATH% is not empty, and you cannot replace it with C:\perl\bin, you can however add C:\perl\bin to the path, which is what you should have done.

Replies are listed 'Best First'.
Re^2: path for perl
by manish.rathi (Acolyte) on Feb 20, 2009 at 22:45 UTC

    Sorry about that improper wordings. Actually C:\perl\bin is added to PATH. Here is the result of "set path"

    "C:\perlfiles>set path PATH=C:\Perl\bin;C:\Program Files\java\jdk1.6.0_11\jre\bin;C:\Program Files\DivX \DivX Player\DivX Player.exe; PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH"

    Question is when cmd.exe is already set in environment variable "ComSpec", why is it not found by "perldoc" ? Is it supposed to be set in any other environment variable ? If thats the case, then whenever any program is using cmd.exe, it will give the same error, right ?

      Question is when cmd.exe is already set in environment variable "ComSpec", why is it not found by "perldoc" ?

      Because "cmd.exe" is only the local name of the file. All versions of the Microsoft file systems also need to know which directory "cmd.exe" resides in. That is the function of %PATH%: to list all the directories where the OS should look when it has only the local name.

      The value of %PATH% you show appears to be missing the directory where cmd.exe is located. For example, in Vista cmd.exe is located in the C:\Windows\System32 directory. I think this is also true for all of the 32 bit versions of Windows (e.g. 95, 2000, XP), but others can verify this.

      The long ugly list of directories that the first few posters said needed to be in PATH are also missing from you %PATH%. They hold not only cmd.exe but several system libraries (DLLs). Many compiled programs only have the local name of the libraries they want and so the MS OSes rely on PATH to find the directory where those libraries are located.

      Paths are searched in the same order they are listed so you'll also want those directories to be the first one's on the path. Otherwise, the OS might find first (and use) a program that just happens to be named "cmd.exe" that isn't the one provided by the OS. Once you've added these directories to your path, things should probably work OK.

      It may not make sense that Windows doesn't just "know" where these things are located, but that's the way it is.

      Best, beth

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://745296]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2024-04-25 20:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found