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:\www\perl\bin; (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.
Popularity: 1% [?]
You can leave a response, or trackback from your own site.


Comments
2 Comments so far. You can leave a response, or trackback from your own site.Thanks for the information. In step 6 I entered c:>perl\bin, restarted the pc, and your command failed (perl is not reconized as an internal command…), even though the path command showed a path to perl\bin. If I changed directories to c:\perl\bin then the following command did work, c:\perl\bin>perl c:\perl\eg\example.pl. Comments?
Mike Daniel
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.