Gossamer Forum
Home : General : Perl Programming :

Died at submit.pl line 289 error?

Quote Reply
Died at submit.pl line 289 error?
Hi ppl,

I've made this script that receives data from a HTML form and then processes it to send SQL queries to a Access Database using Win32::ODBC. The problem is, when I run the script the syntax seems to be OK but perl gives the following errors:
Code:
Possible unintended interpolation of @studyresource in string at submit2_rev.pl
line 12.
Use of uninitialized value in string at submit2_rev.pl line 289.
Died at submit2_rev.pl line 289.

What's happening and how do I fix the script? I've attached the script as submit2.pl

Thanks in advance,

Simon Liu
Quote Reply
Re: [Simonliu] Died at submit.pl line 289 error? In reply to
Try the following changes:

my @censored = ('word', 'word', 'word', 'word', 'word');
$err = " ";
$err_page = <<__END_OF_ERROR__;
Content-type: text/html

<html>

<head>
<title>Error in form processing</title>
</head>

<body>
<h1 align = "center" class = "bold">Error in Input</h1>

<br>

<p class = "bold">Sorry, but you have entered incorrect information, or
have not filled in all fields. Please go to <a href = "../submit.html">
BACK</a> to refill the "Submit a Site" form.

<br>

The exact error is: $err
</p>

<br>

<p class = "legal">If you think this is an error on the Perl script's
form processing part, please send the system administrator an email
at <a href = "mailto:/dev/null\@/dev/urandom.com">
root\@studyresource.com</a>.

<br>

Thank you for your cooperation.

<br>
</p>

</body>

</html>

__END_OF_ERROR__

Basically, I localized the @censored array and added escape characters for the email addresses.

Hope this helps.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Simonliu] Died at submit.pl line 289 error? In reply to
<<HEREDOC's don't interpolate I don't think so you can't place perl variables inside them.
Quote Reply
Re: [Paul] Died at submit.pl line 289 error? In reply to
If I can't interpolate using <<__E_O_F__; then how would I go about what I want to achieve through the code? I have tried to set $error_page as an global variable and just updated $err, but that does not work, since $error_page is not getting updated as well.