Question on SET PATH

D

Dan

I'm new to Perl and trying to figure out how to execute straight from
the C:\ prompt of the DOS window. Currently i have to be in the
C:\Perl\Bin directory to run a script. How can i use the SET PATH
command to run the scripts straight from the C prompt. Thanks !!
 
R

Regent

I assume you installed Perl for Win32. During the installation you should have been told to add Perl to path, so that the system path contains "C:\Perl\Bin", so from any prompt you can run a script directly. I guess your problem is you didn't "add Perl to path". In that case you can manually add "C:\Perl\Bin;" to system path.

------------------------
 
M

Matt Garrish

Dan said:
I'm new to Perl and trying to figure out how to execute straight from
the C:\ prompt of the DOS window. Currently i have to be in the
C:\Perl\Bin directory to run a script. How can i use the SET PATH
command to run the scripts straight from the C prompt. Thanks !!

If you're running Win9x/Me, add the path to your autoexec.bat file. If
you're running one of the NT variants, go to the System settings in the
control panel, find your environment variables and add the path there.

Note also that unless you are on Win2k or XP (not sure about NT anymore),
you will always have to invoke your scripts by typing "perl myscript.pl". If
you are running Win2k or XP, and have files with a .pl extension registered
to be run by perl, you should be able to execute your script using only the
script's name (i.e., "myscript.pl").

Matt
 
S

Sisyphus

Dan said:
I'm new to Perl and trying to figure out how to execute straight from
the C:\ prompt of the DOS window. Currently i have to be in the
C:\Perl\Bin directory to run a script. How can i use the SET PATH
command to run the scripts straight from the C prompt. Thanks !!

set path=C:\Perl\bin;%path%

Cheers,
Rob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top