You would probably best be served by getting a text editor that allows you to run your programs from the editor. Personally I use ConText - syntax highlighting and it's free, plus it lets you set up the function keys to run your Perl programs and lets you see the text output in the bottom window - but there are many others to choose from. Search on here and you'll get many opinions.
That said, the short answer is use the cd command to change to the directory your program is in, and in addition make sure that Perl is in your path - ActiveState should have done that for you I believe. That should do the trick.
Since you're not that good with DOS you'd be best to do a Google search for DOS commands or a DOS tutorial.
Good luck!
Revolution. Today, 3 O'Clock. Meet behind the monkey bars.
I would love to change the world, but they won't give me the source code
| [reply] |
Hi,
The good news is that perl is being found (or you would have got a different error). For the command you gave to work you need to cd the folder that contains example.pl.
As regards finding your way around the shell, Googling for DOS commands turns up some useful links. Here's one such link The information you need will also be accessible under windows Help (try topics involving the term "command line") - but it might take some digging up.
Once you know the name of a command you can also get info about it by typing 'command /?' at the command prompt. For example try running chdir /?
Cheers, Rob | [reply] [d/l] [select] |
I am not very good with dos though. I can't seem to switch to the perl folder.
As a previous monk suggested, you do not need to go to the perl folder, you need to go to the folder where your perl script is, in your case where example.pl is. I like to think I am good with the Windows command line, but here's a tool I love: Command Prompt Here.
Create a new notepad file on your desktop (call it cmdhere.reg or something), put the text from the link in it as per the instructions there, save it, close it, double-click it and click OK to merge it into your registry. Then you can use Windows Explorer to find your perl script and then simply right-click on the folder your script is in to open up a command prompt window where the prompt is already at your script's folder!
How can you feel when you're made of steel? I am made of steel. I am the Robot Tourist. Robot Tourist, by Ten Benson
| [reply] |
Not to discourage you, but your comment that you are "not very good with dos" gives me great concern about the likelihood of success in doing anything very interesting with Perl. (This observation is null and void where prohibited AND/OR where you are just using a windows box because it's available but are already expert with some other Operating System/Command Line Interface :-)
Much of what you're likely to want to do with Perl will be greatly facilitated by understanding your OS. I don't mean to suggest that you have to become a Kernel wizard or a guru on the internals of DOS or Windows (and by the way, since W2K, the Windows offers its CLI via cmd.exe... which has some semi-significant variance from command.com, the interface to the earlier DOS prompt).
But, IMO, in parallel with your early experimentation with perl, you will be very well served by making the effort to "get good" with your operating system, because the strengths of Perl become especially obvious when you learn how easily you can do jobs that would be difficult or impossible (for any given level of skill) from windows, itself.
That said, welcome to the Monastery... and fair winds on your quest. | [reply] |