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

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!

Replies are listed 'Best First'.
Re^4: How to run a perl program from the Windows CMD?
by ww (Archbishop) on Mar 08, 2014 at 12:47 UTC
    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.
        Perhaps I stated that too strongly... or less than clearly.

        I'm not saying that "to have Perl as part of Xampp" is "not enough"; merely that -- IMO, YMMV -- that's doing it the hard way.

        Further, I've never explored the code in Xampp and friends closely enough to say "a newer version of Perl than the one in the distribution could or will cause problems" but updating Perl requires that you update your modules, as well, and -- as newbie Linux users, especially, find out -- that's problematic, if you're replacing the "system Perl." Now, there is no such thing in MS windows packages, but Xampp's Perl may not be totally stock... or the modules to which you might have to upgrade might not have the tweaks Xampp's packagers introduced.

        Come, let us reason together: Spirit of the Monastery

        Quis custodiet ipsos custodes. Juvenal, Satires

        Strawberry Perl portable is shipped with XAMPP. However their "What's included" link contains a copy and paste error, the version of Strawberry Perl has version number copied from Tomcat.

Re^4: How to run a perl program from the Windows CMD?
by Anonymous Monk on Mar 08, 2014 at 11:19 UTC
      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!
Re^4: How to run a perl program from the Windows CMD?
by Anonymous Monk on Apr 16, 2019 at 09:43 UTC
    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.