This is a common query, you need to add a special instruction in the frist line to have it run as a perl script. Have a look here
http://aspn.activestate.co
Main Topics
Browse All Topicsif I have a perl script for example test.pl in Windows XP, how do I run the script by just typing "test.pl <arg1> <arg2>" in the command line instead of having to type "perl test.pl <arg1> <arg2"
I know this is possible because one of the machine at my work is set up in such a way
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
This is a common query, you need to add a special instruction in the frist line to have it run as a perl script. Have a look here
http://aspn.activestate.co
Activestate's install program, by default, will create the proper file associations so that you can execute the scripts without calling perl directly. Since you're unable to execute the scripts without calling perl directly, you must have unchecked the boxes during the installation that would have created those associations. At this point, you'll need to manually create them.
Here's 1 method for creating the association, but there is another more involved approach that give you more control over setting the perameters.
http://support.microsoft.c
Once you're done, you're action attribute should look similar to this:
C:\Perl\bin\perl.exe "%1" %*
I'm a little surprised about the inaccuracy in a portion of the activestate doc that teraplane pointed to.
[quote]
Although Win32 systems themselves don't use the shebang, the Apache webserver does. If you are using the Apache webserver on your Win32 system you should put the shebang line at the top of your CGI scripts.
Your shebang line should look something like:
#!perl
[/quote]
There are 2 inaccuracies. First, Apache on windows doesn't require the use of the shebang line as their statement implies. There is an apache directive (which can be found on/near line 353 of httpd.conf) that tells it to use the file association found in the registry.
ScriptInterpreterSource registry
Second inaccuracy is if you do use the shebang line, it must include the full path to the Perl interpreter just as it does on *nix systems.
thanks all for comments
<tintin> solution wasn't clear enough. Because I already tried associate .pl file before posting Q here but I was using the browse button instead to point to perl.exe location. This works but wouldn't allow use of arguments. (25 points)
<teraplane> solution is kinda off a little. No need for special first line in Windows XP is required like the *nix (sorry no points but thanks for your time)
<FishMonger> however emphasis the use of "C:\Perl\bin\perl.exe "%1" %*" which exactly solved my problem. (100 points)
Business Accounts
Answer for Membership
by: TintinPosted on 2008-02-28 at 19:20:30ID: 21010500
Just set the Windows file association to run ActivePerl for files with extension .pl