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:
- Right click on My Computer and select Properties (or go to Control Panel > System)
- Once the window appears, click Advance
- At the bottom of the window, click on Environmental variable button
- Another windows appears, and in the System variable list, look for a variable called “PATH” and click “Edit”
- 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:
- 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.