943,995 Members | Top Members by Rank

Ad:
  • Perl Discussion Thread
  • Unsolved
  • Views: 25283
  • Perl RSS
You are currently viewing page 1 of this multi-page discussion thread
May 12th, 2005
0

How do i run perl on windows 98

Expand Post »
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
001
Reputation Points: 10
Solved Threads: 0
Newbie Poster
001 is offline Offline
13 posts
since May 2005
May 12th, 2005
0

Re: How do i run perl on windows 98

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:

Perl Syntax (Toggle Plain Text)
  1. 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)
  1. #!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.
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004
May 14th, 2005
0

Re: How do i run perl on windows 98

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
001
Reputation Points: 10
Solved Threads: 0
Newbie Poster
001 is offline Offline
13 posts
since May 2005
May 14th, 2005
0

Re: How do i run perl on windows 98

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.
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004
May 21st, 2005
0

Re: How do i run perl on windows 98

you will see any output that it spits out at you.


I was just wondering if it is not possible to make the output remain on the screen instead of it just spitting it out, making it difficult to see the output.

001
001
Reputation Points: 10
Solved Threads: 0
Newbie Poster
001 is offline Offline
13 posts
since May 2005
May 21st, 2005
0

Re: How do i run perl on windows 98

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.
Team Colleague
Reputation Points: 229
Solved Threads: 149
Grandad
Catweazle is offline Offline
3,826 posts
since Mar 2004
May 21st, 2005
0

Re: How do i run perl on windows 98

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:

Perl Syntax (Toggle Plain Text)
  1. $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.
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004
Jun 2nd, 2005
0

Re: How do i run perl on windows 98

Thanks Comatose,

It worked , but I still experience problems with the output when there are errors in the program. It justs spits out the output and its difficult to read. What do i do.

001
001
Reputation Points: 10
Solved Threads: 0
Newbie Poster
001 is offline Offline
13 posts
since May 2005
Jun 2nd, 2005
0

Re: How do i run perl on windows 98

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:
Perl Syntax (Toggle Plain Text)
  1. 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.
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004
Jul 4th, 2005
0

Re: How do i run perl on windows 98

i tried it, but there was no error message written in the file.
001
Reputation Points: 10
Solved Threads: 0
Newbie Poster
001 is offline Offline
13 posts
since May 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Perl Forum Timeline: stop thread
Next Thread in Perl Forum Timeline: calling one perl program from within another





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC