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

Thank you for the replies everyone, I do have Perl installed on my system because I wrote lots of programs with it, for example this - https://github.com/Stefany93/perl-print-r/blob/master/perl.pl

I have no problems running Perl programs in the browser, but I want to learn how to run them in the CMD because that way I could write desktop programs and that will be cool.

Every time I run the commands with perl in the CMD I get the - "'perl' is not recognized as an internal or externalcommand,operable program or batch file."

Although like I said, I did install Perl long time ago and wrote programs with it, I installed it with the xampp package. Otherwise I think Perl is an awesome language that gets very much under-estimated and people think that Python replaced Perl and that Perl is useless, this is not true.
  • Comment on Re: How to run a perl program from the Windows CMD?

Replies are listed 'Best First'.
Re^2: How to run a perl program from the Windows CMD?
by marto (Cardinal) on Mar 07, 2014 at 10:29 UTC

    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:

    • Right click 'My computer'
    • Select 'Properties' from the drop down list
    • Select 'Advanced'/'Advanced system settings' (depending on OS version)
    • Click 'Environment Variables
    • Add the path to perl.exe in 'System Variables'->'Path'. If you don't know what this path should be search for perl.exe on your system.
    • Open a new command prompt, type perl -v
      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
        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