Forgot to say "thanks for your time"

-----Original Message-----
From: Sally [mailto:[EMAIL PROTECTED]]
Sent: 14 June 2001 11:58
To: John Edwards; Perl Beginners (E-mail)
Subject: RE: mystery


Sorry guys still no luck, I'm gonna knock this one on the head, and abandon
that tutorial.

-----Original Message-----
From: John Edwards [mailto:[EMAIL PROTECTED]]
Sent: 14 June 2001 11:47
To: 'Sally'; Perl Beginners (E-mail)
Subject: RE: mystery


No. Using the print <<HERE_DOC; and the final HERE_DOC lines means you don't
need to quote everything. I was suggesting it as an alternative to quoting
everything.

Upload this to the server as is and try again.

--- Cut here ---

#!/usr/bin/perl -wT

use strict;

#hellocgi

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

print <<HERE_DOC;
<HTML>

<HEAD>
<TITLE>Hello, world!</TITLE>
</HEAD>

<BODY>
<H1>Hello, world!</H1>
</BODY>

</HTML>

HERE_DOC

--- Cut here ---

-----Original Message-----
From: Sally [mailto:[EMAIL PROTECTED]]
Sent: 14 June 2001 11:32
To: John Edwards; Perl Beginners (E-mail)
Subject: RE: mystery


This is what I uploaded and it still didn't work

#!/usr/bin/perl -wT

use strict;

#hellocgi

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

print "<<HERE_DOC";
print"<HTML>";

print"<HEAD>";
print"<TITLE>Hello, world!</TITLE>";
print"</HEAD>";

print"<BODY>";
print"<H1>Hello, world!</H1>";
print"</BODY>";

print"</HTML>";

print"HERE_DOC";

Thanks for the print "...."; tip, I just wish whoever wrote the tutorial had
said that.

-----Original Message-----
From: John Edwards [mailto:[EMAIL PROTECTED]]
Sent: 14 June 2001 11:15
To: 'Sally'; John Edwards; Perl Beginners (E-mail)
Subject: RE: mystery


OK. I think I see it now. Your script has errors in it.

Try the following:


--- Cut here ---
#!/usr/bin/perl -wT

use strict;

#hellocgi

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

print <<HERE_DOC;
<HTML>

<HEAD>
<TITLE>Hello, world!</TITLE>
</HEAD>

<BODY>
<H1>Hello, world!</H1>
</BODY>

</HTML>

HERE_DOC

--- Cut here ---


The web server is parsing the file as a perl script. You have syntax errors
in your Perl script (All the HTML tags, for Perl to parse them in the way
you intend you need to write them as
        print "<HTML>";

and
        print "<\/HTML";

etc

By entering the HTML in your code as a "here" document in the perl script,
it's printed out by Perl as is.

-----Original Message-----
From: Sally [mailto:[EMAIL PROTECTED]]
Sent: 14 June 2001 11:05
To: John Edwards; Perl Beginners (E-mail)
Subject: RE: mystery


Yeah it's right, it's the one I've got from our hosts

-----Original Message-----
From: John Edwards [mailto:[EMAIL PROTECTED]]
Sent: 14 June 2001 11:04
To: 'Sally'; Perl Beginners (E-mail)
Subject: RE: mystery


Is the path the the perl exe correct? Note, copy the list in on your mails.

John

-----Original Message-----
From: Sally [mailto:[EMAIL PROTECTED]]
Sent: 14 June 2001 11:00
To: John Edwards
Subject: RE: mystery


It has recognised .pl scripts in the past (i.e. last week), I do have access
to the error log, unfortunatly it only seems to update itself a couple of
times a day as opposed to everytime it encounters an error

-----Original Message-----
From: John Edwards [mailto:[EMAIL PROTECTED]]
Sent: 14 June 2001 10:58
To: 'Sally'; Perl Beginners (E-mail)
Subject: RE: mystery


OK. Do you have access to the server logs? Have you tried naming the file
hellocgi.cgi (The web server may be configured to recognise CGI scripts only
if they have the .cgi extension)

Does your webserver support running CGI scripts?

John

P.S Please cc the mailing list when you reply. There may be others following
this thread who also have the same problem or input on a solution.

-----Original Message-----
From: Sally [mailto:[EMAIL PROTECTED]]
Sent: 14 June 2001 10:54
To: John Edwards
Subject: RE: mystery


the perl one is www.servon.uk.com/cgi-bin/hellocgi.pl
the html one is ..........................hellocgi.html

-----Original Message-----
From: John Edwards [mailto:[EMAIL PROTECTED]]
Sent: 14 June 2001 10:50
To: 'Sally'; Perl Beginners (E-mail)
Subject: RE: mystery


Can you give me the URL of this file?

-----Original Message-----
From: Sally [mailto:[EMAIL PROTECTED]]
Sent: 14 June 2001 10:41
To: John Edwards
Subject: RE: mystery


That has all been done, and the file was uploaded in ascii mode and not
binary

-----Original Message-----
From: John Edwards [mailto:[EMAIL PROTECTED]]
Sent: 14 June 2001 10:19
To: 'Sally'; perl
Subject: RE: mystery


What operating system does the webserver run? If it's Unix or similar you
need to set the properties of the file so that all user can execute the
file. Normally you'll want to chmod the file to a value of 755.

See this for some more details http://www.waferthin.com/manual/manual5.html

The server also needs to be configured to run CGI scripts. Normally you'll
have to place your file in the cgi-bin directory of your site and give it an
extension of .cgi or .pl

HTH

John

-----Original Message-----
From: Sally [mailto:[EMAIL PROTECTED]]
Sent: 14 June 2001 09:54
To: perl
Subject: mystery


I got the following code from a tutorial. When I uploaded (FTP) it as a perl
file I got more errors than you could shake a stick at. When I uploaded it
as an html file it sort of worked, ie it printed out the "Hello world" but
it printed out everything else too. I think I understand why it worked as
html, but I don't understand why it didn't work as perl. Any suggestions
would be appreciated, and if you were the one who wrote this code on the
tutorial, please can you offer suggestions as to why code may fail.

#!/usr/bin/perl -wT

use strict;

&error;

#hellocgi

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

&error;

<HTML>

&error;

<HEAD>
<TITLE>Hello, world!</TITLE>
</HEAD>

&error;

<BODY>
<H1>Hello, world!</H1>
</BODY>

&error;

</HTML>


sub error {
    my( $q, $error_message ) = @_;

    print $q->header( "text/html" ),
          $q->start_html( "Error" ),
          $q->h1( "Error" ),
          $q->p( "Sorry, the following error has occurred: " );
          $q->p( $q->i( $error_message ) ),
          $q->end_html;
    exit;
}


--------------------------Confidentiality--------------------------.
This E-mail is confidential.  It should not be read, copied, disclosed or
used by any person other than the intended recipient.  Unauthorised use,
disclosure or copying by whatever medium is strictly prohibited and may be
unlawful.  If you have received this E-mail in error please contact the
sender immediately and delete the E-mail from your system.



--------------------------Confidentiality--------------------------.
This E-mail is confidential.  It should not be read, copied, disclosed or
used by any person other than the intended recipient.  Unauthorised use,
disclosure or copying by whatever medium is strictly prohibited and may be
unlawful.  If you have received this E-mail in error please contact the
sender immediately and delete the E-mail from your system.



--------------------------Confidentiality--------------------------.
This E-mail is confidential.  It should not be read, copied, disclosed or
used by any person other than the intended recipient.  Unauthorised use,
disclosure or copying by whatever medium is strictly prohibited and may be
unlawful.  If you have received this E-mail in error please contact the
sender immediately and delete the E-mail from your system.



--------------------------Confidentiality--------------------------.
This E-mail is confidential.  It should not be read, copied, disclosed or
used by any person other than the intended recipient.  Unauthorised use,
disclosure or copying by whatever medium is strictly prohibited and may be
unlawful.  If you have received this E-mail in error please contact the
sender immediately and delete the E-mail from your system.



--------------------------Confidentiality--------------------------.
This E-mail is confidential.  It should not be read, copied, disclosed or
used by any person other than the intended recipient.  Unauthorised use,
disclosure or copying by whatever medium is strictly prohibited and may be
unlawful.  If you have received this E-mail in error please contact the
sender immediately and delete the E-mail from your system.



--------------------------Confidentiality--------------------------.
This E-mail is confidential.  It should not be read, copied, disclosed or
used by any person other than the intended recipient.  Unauthorised use,
disclosure or copying by whatever medium is strictly prohibited and may be
unlawful.  If you have received this E-mail in error please contact the
sender immediately and delete the E-mail from your system.


Reply via email to