Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Script displays in dos window, not browser

Reply
Thread Tools

Script displays in dos window, not browser

 
 
Joe Burnett
Guest
Posts: n/a
 
      08-10-2003
Hello,

I am trying to run a trivial perl script, but the results either get
displayed in a dos window,
or the source code gets displayed in a browser. The former happens when I
open the script
in IE with a pl extension. The latter happens if I open the script with a
cgi extension. Both
scripts reside in "C:\Program Files\Apache Group\Apache2\cgi-bin".
Obviously, I have an
apache server (the service is started, as well as two apache.exe processes).
I have ActiveState
perl installed. Here is the script:

#!C:\Perl\bin\perl.exe

print "Content-type: text/html\n\n";

print "<html>\n<head><title>First CGI</title></head>\n";

print "<body><h1>\n";

print "Hello world!!";

print "</h1>\n </body>\n</html>\n";

I have been looking in the news groups for two days to no avail.

Thanks,

Joe




 
Reply With Quote
 
 
 
 
Jürgen Exner
Guest
Posts: n/a
 
      08-10-2003
Joe Burnett wrote:
> I am trying to run a trivial perl script, but the results either get
> displayed in a dos window,


Well, then apparently the Perl script works perfectly fine: it prints
exactly what it is supposed to print.

> or the source code gets displayed in a browser.
> I have an apache server

[...]
> I have been looking in the news groups for two days to no avail.


Doesn't surprise me. You are looking the wrong place.
You should check out a NG that actually deals with Apache to find out how to
configure Apache.

jue


 
Reply With Quote
 
 
 
 
Gregory Toomey
Guest
Posts: n/a
 
      08-10-2003
"Joe Burnett" <> wrote in message
news:UyAZa.116059$uu5.17089@sccrnsc04...
> Gregory, thanks for the reply.
> > Looking for two days? Where? If you spent 2 days reading the Apache
> > documentation you should know it by heart.

> Well, off and on for two days. Even if I did know the Apache stuff by

heart,
> I don't think it would help. I implemented the changes you suggested and

the
> behavio(u)r did not change. Still get either a DOS window (.pl) or the
> source
> code displayed in IE (.cgi).
>
> Do you have any other suggestions? Is the fact that I have a Windows XP

Pro
> as my server, but have specified DHCP to get the IP address (which by the
> way
> matches the address in my httpd.conf) creating the problem?
>
> Thanks again,
>
> Joe
>


Step number 1 to to make sure you can access regular html.
eg http://www.yoursite.com/mypage.html
If you can't even do that then you need to sort out DNS issues.

When you have that working you can try something like
http://www.yoursite.com/cgi/bin/script.cgi


gtoomey




 
Reply With Quote
 
Islaw
Guest
Posts: n/a
 
      08-11-2003
Alan C. wrote:
>
> http://perl.about.com/cs/beginningperl/
>
> http://perl.about.com/cs/intermediateperl/


That is a nice site indeed, but I do find it amusing that they have
ads/links for spam removal on a site thats just full of them ;p

--
Islaw


 
Reply With Quote
 
Joe Burnett
Guest
Posts: n/a
 
      08-12-2003
Thanks, Alan, Gregory and Jürgen,

I tried your suggestions to no avail on my home based Windows XP system. I
have located a linux based
web server that runs both myscript.cgi and myscript.pl with the expected
results showing up in my browser.
I am able to develope now. I'll get back to my home system later this week.

Thanks again,

Joe Burnett

"Alan C." <> wrote in message
news:...
> "Joe Burnett" <> wrote in message
> news:KluZa.113785$Ho3.14438@sccrnsc03...
> > Hello,
> >
> > I am trying to run a trivial perl script, but the results either get
> > displayed in a dos window,
> > or the source code gets displayed in a browser. The former happens when

I
> > open the script
> > in IE with a pl extension. The latter happens if I open the script with

a
> > cgi extension.

>
> But how is the open accomplished? is it like do you enter into the

address
> bar of the browser something near/like:
>
> http://localhost/cgi-bin/myscript.cgi
>
> >Both
> > scripts reside in "C:\Program Files\Apache Group\Apache2\cgi-bin".

>
> File location looks ok. What happen if U do
> localhost/cgi-bin/scriptname.cgi as I mentioned further above
>
> --
>
> http://perl.about.com/cs/beginningperl/
>
> http://perl.about.com/cs/intermediateperl/
>
> very near those above two is also some cgi info. a "Perl 101 class" which
> focuses on Perl cgi & web server a few basics
>
> --
> Alan.
>
>
>



 
Reply With Quote
 
Joe Burnett
Guest
Posts: n/a
 
      08-12-2003
Thanks, Alan, Gregory and Jürgen,

I tried your suggestions to no avail on my home based Windows XP system. I
have located a linux based
web server that runs both myscript.cgi and myscript.pl with the expected
results showing up in my browser.
I am able to develope now. I'll get back to my home system later this week.

Thanks again,

Joe Burnett

"Alan C." <> wrote in message
news:...
> "Joe Burnett" <> wrote in message
> news:KluZa.113785$Ho3.14438@sccrnsc03...
> > Hello,
> >
> > I am trying to run a trivial perl script, but the results either get
> > displayed in a dos window,
> > or the source code gets displayed in a browser. The former happens when

I
> > open the script
> > in IE with a pl extension. The latter happens if I open the script with

a
> > cgi extension.

>
> But how is the open accomplished? is it like do you enter into the

address
> bar of the browser something near/like:
>
> http://localhost/cgi-bin/myscript.cgi
>
> >Both
> > scripts reside in "C:\Program Files\Apache Group\Apache2\cgi-bin".

>
> File location looks ok. What happen if U do
> localhost/cgi-bin/scriptname.cgi as I mentioned further above
>
> --
>
> http://perl.about.com/cs/beginningperl/
>
> http://perl.about.com/cs/intermediateperl/
>
> very near those above two is also some cgi info. a "Perl 101 class" which
> focuses on Perl cgi & web server a few basics
>
> --
> Alan.
>
>
>



 
Reply With Quote
 
Joe Burnett
Guest
Posts: n/a
 
      08-12-2003
Thanks, Alan, Gregory and Jürgen,

I tried your suggestions to no avail on my home based Windows XP system. I
have located a linux based
web server that runs both myscript.cgi and myscript.pl with the expected
results showing up in my browser.
I am able to develope now. I'll get back to my home system later this week.

Thanks again,

Joe Burnett

"Alan C." <> wrote in message
news:...
> "Joe Burnett" <> wrote in message
> news:KluZa.113785$Ho3.14438@sccrnsc03...
> > Hello,
> >
> > I am trying to run a trivial perl script, but the results either get
> > displayed in a dos window,
> > or the source code gets displayed in a browser. The former happens when

I
> > open the script
> > in IE with a pl extension. The latter happens if I open the script with

a
> > cgi extension.

>
> But how is the open accomplished? is it like do you enter into the

address
> bar of the browser something near/like:
>
> http://localhost/cgi-bin/myscript.cgi
>
> >Both
> > scripts reside in "C:\Program Files\Apache Group\Apache2\cgi-bin".

>
> File location looks ok. What happen if U do
> localhost/cgi-bin/scriptname.cgi as I mentioned further above
>
> --
>
> http://perl.about.com/cs/beginningperl/
>
> http://perl.about.com/cs/intermediateperl/
>
> very near those above two is also some cgi info. a "Perl 101 class" which
> focuses on Perl cgi & web server a few basics
>
> --
> Alan.
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IOS DoS defense causes DoS to itself:) Igor Mamuziæ Cisco 2 05-19-2006 11:59 PM
Anybody know why the exact same browser but different machines displays content differently? Geoff Coope HTML 3 03-25-2006 03:26 PM
Classic asp date displays- changing over to aspnet date object displays Chumley Walrus ASP .Net 1 12-16-2004 09:57 PM
Unable to run MS-DOS in Windows and DOS properties tabs missing Don Computer Support 5 02-11-2004 07:20 PM
Executing DOS (yes, DOS) program from within Python? Ben Fairbank Python 2 10-07-2003 08:51 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57