How do I make .pl run as perl programs on windows

AID: 1002
  • Status: Published

2710 points

  • ByAdam314
  • TypeTips/Tricks
  • Posted on2009-06-19 at 13:55:53
On Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with the perl interpreter.  This is normally done by the installer, but not always.

To associate files:
    1) Start windows explorer
    2) Select, from the menu, Tools -> Folder Options
    3) Select the File Types tab
    4)  Look in the list for a PL extension.  If it does NOT exist:
        4a) Click New
        4b) Type pl for extension
    5) Select the PL extension in the list
    6) In the section "opens with", click Change
    7) Select perl.exe
    8) Click OK until all windows are closed.
Asked On
2009-06-19 at 13:55:53ID1002
Tags

perl file extension association

Topic

Perl Programming Language

Views
2054

Comments

Author Comment

by: Adam314 on 2009-06-19 at 15:27:12ID: 1720

I've seen this issue several time in the perl programming zone.  The problem is that, on windows, the file extension is used to determine how a file should be handled.  If, when installing perl, the .pl file extension is not associated with the perl interpreter, then, when the user tries to run the perl program by double-clicking the file, or typing the name, they get an error.

The solution is very simple - associate the .pl file extension with the perl interpreter.  This is the reason for so few words.

Perhaps this isn't worthy of an article.  I decided to write it because I've seen the problem several times, and thought it would be helpful.  

Expert Comment

by: mrjoltcola on 2009-06-19 at 16:44:59ID: 1724

Changing status to notify. Apologies, the articles system is still sort of a "beta" status. Please see my 2 comments above.

Author Comment

by: Adam314 on 2009-06-22 at 09:56:06ID: 1738

I'll update the instructions to work with Vista also.  I only have XP to test, but from your notes, it seems that the right-click method works on both XP and vista, so I'll provide instructions for that method.

Add your Comment

Please Sign up or Log in to comment on this article.

Join Experts Exchange Today

Gain Access to all our Tech Resources

Get personalized answers

Ask unlimited questions

Access Proven Solutions

Search 3.2 million solutions

Read In-Depth How-To Guides

1000+ articles, demos, & tips

Watch Step by Step Tutorials

Learn direct from top tech pros

And Much More!

Your complete tech resource

See Plans and Pricing

30-day free trial. Register in 60 seconds.

Loading Advertisement...

Top Perl Experts

  1. ozo

    100,340

    Master

    0 points yesterday

    Profile
    Rank: Savant
  2. farzanj

    60,737

    Master

    0 points yesterday

    Profile
    Rank: Genius
  3. FishMonger

    45,500

    0 points yesterday

    Profile
    Rank: Genius
  4. wilcoxon

    39,566

    0 points yesterday

    Profile
    Rank: Sage
  5. kyanwan

    16,300

    0 points yesterday

    Profile
  6. bounsy

    15,700

    0 points yesterday

    Profile
    Rank: Wizard
  7. parparov

    14,460

    0 points yesterday

    Profile
    Rank: Guru
  8. ahoffmann

    14,252

    0 points yesterday

    Profile
    Rank: Genius
  9. simon3270

    11,550

    0 points yesterday

    Profile
    Rank: Wizard
  10. BinaryWarrior

    10,833

    0 points yesterday

    Profile
  11. kaufmed

    9,856

    0 points yesterday

    Profile
    Rank: Genius
  12. DaveBaldwin

    8,582

    0 points yesterday

    Profile
    Rank: Genius
  13. xterm

    8,500

    0 points yesterday

    Profile
    Rank: Sage
  14. woolmilkporc

    6,372

    0 points yesterday

    Profile
    Rank: Genius
  15. Ray_Paseur

    5,900

    0 points yesterday

    Profile
    Rank: Savant
  16. sjklein42

    5,468

    0 points yesterday

    Profile
    Rank: Sage
  17. arnold

    5,100

    0 points yesterday

    Profile
    Rank: Genius
  18. pfrancois

    4,888

    0 points yesterday

    Profile
    Rank: Guru
  19. Tintin

    4,268

    0 points yesterday

    Profile
    Rank: Genius
  20. johanntagle

    4,000

    0 points yesterday

    Profile
    Rank: Sage
  21. Papertrip

    4,000

    0 points yesterday

    Profile
    Rank: Sage
  22. slightwv

    3,800

    0 points yesterday

    Profile
    Rank: Genius
  23. nemws1

    3,800

    0 points yesterday

    Profile
    Rank: Sage
  24. bazika

    3,668

    0 points yesterday

    Profile
  25. dragon-it

    3,650

    0 points yesterday

    Profile
    Rank: Genius

Hall Of Fame