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.

2 thoughts on “I Can’t User Perl In Windows Comman Line – Solved”

  1. Thanks for the information. In step 6 I entered c:>perlbin, restarted the pc, and your command failed (perl is not reconized as an internal command…), even though the path command showed a path to perlbin. If I changed directories to c:perlbin then the following command did work, c:perlbin>perl c:perlegexample.pl. Comments?
    Mike Daniel

  2. Mike: Hrmmm, I don’t have any thoughts at the moment as to why it’s not working for you. If I come across something, I’ll let you know.

Leave a Reply

Your email address will not be published. Required fields are marked *