in reply to Re: How to run a perl program from the Windows CMD?
in thread How to run a perl program from the Windows CMD?

For clarity, are you still unable to run perl from the command prompt? If so ensure that the path to perl is in your PATH variable:

Replies are listed 'Best First'.
Re^3: How to run a perl program from the Windows CMD?
by Stefany (Acolyte) on Mar 08, 2014 at 11:13 UTC
    Thank you, I did what you told me, I added Perl to the ENV variables like this:
    C:\Program Files (x86)\PC Connectivity Solution\;C:\Program Files (x8 +6)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD APP\bin;C:\xampp\php +\zend_framework\bin;C:\Program Files (x86)\Lua\5.1;C:\Program Files ( +x86)\Lua\5.1\clibs;C:\xampp\php;C:\ProgramData\Composer\bin;C:\Progra +m Files\TortoiseSVN\bin;c:\Program Files (x86)\Microsoft SQL Server\1 +10\Tools\Binn\;c:\Program Files\Microsoft SQL Server\110\Tools\Binn\; +c:\Program Files\Microsoft SQL Server\110\DTS\Binn\;C:\xampp\perl\bin +\perl.exe
    And when I run  perl -v in the CMD like this:
    C:\Users\Stefany>perl -v
    I get this error -
    'perl' is not recognized as an internal or external command, operable program or batch file.
    Please help!
      Unless you're writing solely for web-oriented purposes, you'll be a lot better off downloading any one of the distros of Perl often cited here -- ActiveState, Strawberry, perlbrew, etc -- than trying to rely on Xampp's package. If nothing else, installing your own in C:\ or C:\Program Files will save you grief when you update... and most of Perl5's updates are well worth having.

      That may well mean that some of what you write (non-web utilities, searches, etc) for the current non-Xampp version may bork should you simply move the code to Xampp, and will (eventually, if not today) require that you update/add modules via ppm or CPAN, but those are low prices compared to getting locked into what's likely to be an outdated version of Perl, in the Xampp bundle.

      Come, let us reason together: Spirit of the Monastery
        Thank you, I didn't know it wasn't enough to have Perl as part of Xampp I will download Strawberry Perl too.
        IT WORKED! I am so happy! Thank you and thanks to everyone who were so kind to help me! I didn't know %PATH% wanted only folders! I removed the perl.exe ending and when I ran perl -v in the CMD I got this:
        Copyright 1987-2012, Larry Wall Perl may be copied only under the terms of either the Artistic License + or the GNU General Public License, which may be found in the Perl 5 source ki +t. Complete documentation for Perl, including FAQ lists, should be found +on this system using "man perl" or "perldoc perl". If you have access to + the Internet, point your browser at http://www.perl.org/, the Perl Home Pa +ge.
        Then I ran this command  perl test.pl And it output "Hello World" rather than opening the file! Thank you soo much everyone!
      You need to come to C:\> and then type perl -v for the perl script to run It should look like this: C:\>perl -v

        This is not true, the mistake the user made was corrected years ago.