Hi All,

Well, I have fixed the problem.  I converted the messy html output from a
series of ugly print statements (complete with escaping for every "
character) to a heredoc as follows:

print <<HTML_OUTPUT;
... HTML stuff here ...
HTML_OUTPUT

Also, I found an array initialisation in my code that might have been
incorrect:
my @array_name = '';

so changed it to:
my @array_name = ();

I no longer get any CGI Errors with missing quotes. :)  However, I am still
not sure which of the two changes I made above fixed the problem because I
changed them both before trying out the script - possibly both?  Anyway, I
am now a heredoc follower for the larger html output sections - much cleaner
and less time consuming to write!

Thanks again for your ideas and suggestions guys,
Mike.


-----Original Message-----
From: Octavian Rasnita [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 06 August, 2003 7:44 PM
To: Mike Harrison; Jon Hogue
Cc: 'Andrew Brosnan'; [EMAIL PROTECTED]
Subject: Re: Perl line breaks


This code is working fine under Windows, but maybe you have made some
mistakes in your subroutine that  prints the header...

You don't need to print so many separate lines using the print "...";
function.

You can use:

print <<EOF;
<html>....
....
</html>
EOF

Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]

----- Original Message -----
From: "Mike Harrison" <[EMAIL PROTECTED]>
To: "'Octavian Rasnita'" <[EMAIL PROTECTED]>; "Jon Hogue" <[EMAIL PROTECTED]>
Cc: "'Andrew Brosnan'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, August 06, 2003 2:24 AM
Subject: RE: Perl line breaks


I was trying to find a log file to look at.  I guess half the problem is I
am using a hosting service, and it is on a Microsoft IIS server (Windows
NT-based I think, but definitely not UNIX).  I will have to ask the hosting
admin where I might find a log file...

Here is the part of the perl script that I start printing things to the
browser (see previous message for the html.pm script that contains the
HTML_header and HTML_ender subroutines):

my $header = 'Successful update';
my $msg = "<h2>Your preferences have been updated
successfully...</h2><hr><br><br><br>";

# Finally, put up a HTML document announcing that the update was successful.
&HTML_header($header);
print "<body>\n";
print "<center>\n";
print "$msg\n";
print "<p>Return to the <a href=\"amtest.pl?uname=$uname\"
onMouseover=\"window.status='Back to account management'; return true\"
onMouseout=\"window.status=''; return true\">Account Management</a>
page</p>\n";
print "</center>\n";
&HTML_ender;

Note that I have also tried using print qq| ... | code as well.

I am now getting a CGI error message along the lines of
Cannot find a string terminator '"' in ... line ... (the line above starting
with print "<p>... ".  I can't find a problem with that line???

Thanks for your help so far guys!  I am losing a bit of sleep on this one :(
Regards,
Mike.


-----Original Message-----
From: Octavian Rasnita [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 06 August, 2003 2:30 AM
To: Jon Hogue
Cc: Mike Harrison; 'Andrew Brosnan'; [EMAIL PROTECTED]
Subject: Re: Perl line breaks


For troubleshooting a script you can take a look in the server's log file
and you will find there any error.

Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]

----- Original Message -----
From: "Jon Hogue" <[EMAIL PROTECTED]>
To: "Octavian Rasnita" <[EMAIL PROTECTED]>
Cc: "Mike Harrison" <[EMAIL PROTECTED]>; "'Andrew Brosnan'"
<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, August 05, 2003 4:19 PM
Subject: Re: Perl line breaks



>
>...and you don't need to print the HTML header in the BEGIN {} block.
>You can just print it at the top of the perl program or in the middle of
the
>program but before anything else is printed.

if something is dieing in a module you are loading, you will never know
about it because it will never get to the Content-Type and therefore never
send anything good to your browser. if you use a BEGIN block, you might
catch things that happen in modules you load. i wouldn't recommend doing
that for your normal script, but it is a useful troubleshooting tool.





Reply via email to