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:\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.

Related Posts with Thumbnails

Popularity: 1% [?]

You can leave a response, or trackback from your own site.
2 Comments Technology, Web 1 views Share URL: http://bit.ly/4wKkNv

Comments

2 Comments so far. You can leave a response, or trackback from your own site.
  1. mike daniel,

    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

  2. Richard Bui,

    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.

Add Your Comments

Required
Required
Tips

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <ol> <ul> <li> <q cite=""> <strike> <strong> <sub> <sup> <u>

Your email is never published nor shared.

Ready?