I Can’t User Perl In Windows Comman Line – Solved

I was beating myself over the head for hours wondering why I wasn’t able to do something simple as running this in the Windows Command line:

C:>perl example.pl

I would constantly get berated by Windows with:

'perl' is not recognized as an internal or external command, operable program or batch file.

Turns out the solution is:

  1. Right click on My Computer and select Properties (or go to Control Panel > System)
  2. Once the window appears, click Advance
  3. At the bottom of the window, click on Environmental variable button
  4. Another windows appears, and in the System variable list, look for a variable called “PATH” and click “Edit”
  5. You will see something like: %SystemRoot%system32;%SystemRoot%;…and it may have other entries depending on what has been installed on your system, but what you want to add in front of it is:
  6. c:wwwperlbin; (or where the perl.exe file is)

Now you should be able to run:

C:>perl example.pl

and get:

C:>perl example.pl
Hello from ActivePerl!

Credit belongs to alucard01 from Apache Friends Forum. The post can be found here.