Computer Help forum

General discussion


I have a problem with Perl. I installed ActiveState Perl on my Windows XP machine, but programs won?t accept command line input. The documentation to a program I want to run says:

If [the program] refuses to recognize any command-line arguments, make sure you're set up to invoke Perl on .pl documents as follows:

''C:\Perl\bin\perl.exe'' %1 %*

(or whatever the path to perl.exe is on your system).

I don?t know what this means. When I type ''C:\Perl\bin\perl.exe'' %1 %* at the command line, it says Can't open perl script ''%1'': No such file or directory. Does anyone know how to fix this problem?


Discussion is locked
You are posting a reply to: Perl
The posting of advertisements, profanity, or personal attacks is prohibited. Please refer to our CNET Forums policies for details. All submitted content is subject to our Terms of Use.
Track this discussion and email me when there are updates

If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.

You are reporting the following post: Perl
This post has been flagged and will be reviewed by our staff. Thank you for helping us maintain CNET's great community.
Sorry, there was a problem flagging this post. Please try again now or at a later time.
If you believe this post is offensive or violates the CNET Forums' Usage policies, you can report it below (this will not automatically remove the post). Once reported, our moderators will be notified and the post will be reviewed.
Collapse -

In reply to: Perl

You're misinterpreting the instructions. Those instructions are for if you want to set up a file association with .pl files, so that you can run them like any other executable program.

If you want to run a Perl script from the command line yourself, it would be something like: C:\Perl\bin\perl.exe <argument1> <argument2> <argumentn>

(Everything in <>'s is optional)

Of course if you're actually in the directory C:\Perl\bin, you can shorten the first part to just perl.exe, or you could add C:\Perl\bin to your PATH and then no matter where you are, it's just perl.exe for the first part.

And nothing personal, but if these sorts of issues are giving you trouble, a language like Perl probably isn't for you. You might want to try something a little bit more newbie friendly. Python has a fantastic interactive mode built into the interpreter. Other languages have tried to create something similar, and I've yet to see one even come close to comparing. Even my own favorite language Ruby.

Collapse -
That's not quite the problem...

In reply to: IIRC

My problem isn?t that I can?t invoke Perl form the command line (I can, as it is already added to the Path), the problem is that when I do launch a program it won?t accept input. The program was downloaded off of the Internet and is known to work. When I run it, it asks for input, but nothing I type at the keyboard shows up.

Collapse -
Well then...

In reply to: That's not quite the problem...

Looks like I skimmed your first post a bit too quickly.

The instructions you quoted, as I stated before, are for setting up file associations for .pl files. Create one of those, then run the Perl program by double clicking the .pl file, and it will probably work.

Otherwise, I would suggest trying to put the script name before the "%1 %*" bit, and see if that works. And if not, run "perl.exe -h" and start reading about the different command line switches. You might be able to find some options that will achieve the desired effect.

Or, in the end, recognize that there are some subtle bugs that are unavoidable due to the large differences between Unix (which is what Perl development is focused on), and Windows. Despite some admirable efforts on the part of the ActiveState people, not every Perl program is going to work on Windows. If there's any way you could swap in a Linux or FreeBSD box, I think you'd find the results much more to your liking. If nothing else, the man pages can be a real lifesaver and time saver.

Collapse -
Thank you thought_stazi

In reply to: Well then...

Thanks for the advice. You said suggested that perl would work better under in a Unix like environment, so I tried installing it under CYGWIN and everything works now. There has to be some way to get ActiveState for Windows to recognize keyboard input, but this solution works just fine.

Thanks again.

Popular Forums

Computer Newbies 10,686 discussions
Computer Help 54,365 discussions
Laptops 21,181 discussions
Networking & Wireless 16,313 discussions
Phones 17,137 discussions
Security 31,287 discussions
TVs & Home Theaters 22,101 discussions
Windows 7 8,164 discussions
Windows 10 2,657 discussions


This one tip will help you sleep better tonight

A few seconds are all you need to get a better night's rest.