| | |
How do i run perl on windows 98
![]() |
•
•
Join Date: May 2005
Posts: 13
Reputation:
Solved Threads: 0
Hello,
I am new to perl, and am using perl on windows 98, i have tried writting a program, but the problem i experiencing is how to run the program.
1 i am using active perl 5 which came with an installer
2.i use note pad for the program and saved with the extension .pl
What do i do to run this program. Please help.
001
I am new to perl, and am using perl on windows 98, i have tried writting a program, but the problem i experiencing is how to run the program.
1 i am using active perl 5 which came with an installer
2.i use note pad for the program and saved with the extension .pl
What do i do to run this program. Please help.
001
You could post the code, if it's a program with the code. One thing that I like to do is use a dos prompt and try to run the file.... you MIGHT have to load the perl Executable and pass the file as a parameter, something like:
I have it running on my XP box, and I can just double click it, or type the name of the .pl file, as if it were an exe, com or bat. However, the first line of the perl file should be the path to your perl.exe... so:
It might be different on your system, I'm not sure, but if none of those solutions work, post your code, and we'll check it out.
Perl Syntax (Toggle Plain Text)
c:\perl\bin\perl.exe myfile.pl
I have it running on my XP box, and I can just double click it, or type the name of the .pl file, as if it were an exe, com or bat. However, the first line of the perl file should be the path to your perl.exe... so:
Perl Syntax (Toggle Plain Text)
#!c:\perl\bin\perl.exe
It might be different on your system, I'm not sure, but if none of those solutions work, post your code, and we'll check it out.
•
•
Join Date: May 2005
Posts: 13
Reputation:
Solved Threads: 0
c:\perl\bin\perl.exe myfile.pl
where do i write that, on the run command of windows or the ppm of perl. On the ppm command, it does not recognize it while it says "file not found on the run command of windows".
c:\perl\bin\perl.exe is where mine is.
Actually, when i wrote the program in notepad, i save it on my desktop. It has the perl icon, but the problem is, when i double-click the icon for the program, the perl DOS screen pops-up with the output and disappears within a second such that you cannot see the output.
Any suggestions please.
001
where do i write that, on the run command of windows or the ppm of perl. On the ppm command, it does not recognize it while it says "file not found on the run command of windows".
c:\perl\bin\perl.exe is where mine is.
Actually, when i wrote the program in notepad, i save it on my desktop. It has the perl icon, but the problem is, when i double-click the icon for the program, the perl DOS screen pops-up with the output and disappears within a second such that you cannot see the output.
Any suggestions please.
001
Well, You could click on start, go to run, type in cmd, and then use the dos interface to run the perl program. You put the #!c:\perl\bin\perl.exe as the very first line in your perl file. I might be confused, but it sounds like you are writing a perl module, and not an actual perl script, because most perl modules end in .pm, or I'm guessing too .ppm. However, if you run the script from the command line, you will see any output that it spits out at you.
•
•
Join Date: Mar 2004
Posts: 3,826
Reputation:
Solved Threads: 144
This Introductions section is for members to introduce themselves, not for technical questions to be asked and answered. As we have a forum section specifically for Perl I'll move the topic to it.
Thanx Catweazle, I completely missed that one! :-|
001:
By using the dos prompt, the information that gets display stays on the screen. That's the whole point behind using the dos prompt. The information displayed will stay on the screen. In windows, as soon as you run your perl file, and it finishes, it closes the spawned dos-window that runs the perl file. If you are not very proficient at using DOS, another solution that can be used for testing purposes only is to add a:
Before the program terminates. However, this requires you to hit enter, before the program will quit (if you put it before an exit or die), but it's easy to forget about it being in there... and it isn't really a good method of debugging. The best solution, is to run perl from the command line, passing your program as the parameter.
001:
By using the dos prompt, the information that gets display stays on the screen. That's the whole point behind using the dos prompt. The information displayed will stay on the screen. In windows, as soon as you run your perl file, and it finishes, it closes the spawned dos-window that runs the perl file. If you are not very proficient at using DOS, another solution that can be used for testing purposes only is to add a:
Perl Syntax (Toggle Plain Text)
$tmpvar = <STDIN>;
Before the program terminates. However, this requires you to hit enter, before the program will quit (if you put it before an exit or die), but it's easy to forget about it being in there... and it isn't really a good method of debugging. The best solution, is to run perl from the command line, passing your program as the parameter.
Well, An Alternative Method is to use a filename for all your output, so, for example, in one program that I made, I needed all the Error Messages To Go To A Log File, So I stuck This at the top of my program:
Then any error message that I needed to read, would be in the same folder as my script, in a file called "log". I think you can do the same for STDOUT, and have all output belonging to the screen redirected to a file also. Let me know how it turns out.
Perl Syntax (Toggle Plain Text)
open(STDERR, ">>log");
Then any error message that I needed to read, would be in the same folder as my script, in a file called "log". I think you can do the same for STDOUT, and have all output belonging to the screen redirected to a file also. Let me know how it turns out.
![]() |
Other Threads in the Perl Forum
- Previous Thread: stop thread
- Next Thread: calling one perl program from within another
| Thread Tools | Search this Thread |






