CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
getting past step one.

 



TedW
Deleted

Nov 18, 2000, 1:50 PM

Post #1 of 3 (284 views)
getting past step one. Can't Post

Hi everybody.
I've decided to learn perl but I'm off to a rough start. My first program, monkey.cgi, I got from Elizabeth Castro's book "Perl and CGI for the WWW. Here it is verbatum:

#!/usr/local/bin/perl

print"show me the monkey";

Pretty simple, huh? I used WS_PRO to upload it to my cgi bin, made sure I checked the ASCII button, and then went to my cgi-bin and changed the permission to 755. When I use my browser (IE5)to view my work of art I get the "download" option of open from current location or save it to disk. What might I be doing wrong?

Thanks, TedW


sleuth
Enthusiast

Nov 18, 2000, 9:11 PM

Post #2 of 3 (284 views)
Re: getting past step one. [In reply to] Can't Post

 
You forgot the line

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

Which the browser needs.

When ever you want to print any text or html in your script, make sure you print that first.

Sleuth


perlmaster
Deleted

Nov 19, 2000, 7:20 PM

Post #3 of 3 (284 views)
Re: getting past step one. [In reply to] Can't Post

Hello TedW!


very simple and cool script you have made
but U did not made it CGI compatible

to do that you have to rewite the code as

#!/usr/bin/perl

# this tells the browser that the out put of your cgi program is text and or HTML

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

# now what u wanted
print "Hello I am Ted , I love perl ";

Enjoy :)



------------------
Ahmad Mushtaq
www.cbird.com.pk
webmaster@cbird.f2s.com

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives