Re: Use of uninitialized value Error
- From: "daniel kaplan" <nospam@xxxxxxxxxx>
- Date: Sun, 21 Aug 2005 23:59:25 -0400
"A. Sinan Unur" <1usa@xxxxxxxxxxxxxxxxxxx> wrote in message
news:Xns96B9B709FE392asu1cornelledu@xxxxxxxxxxxx
>
> To suppress the warning, you can use
> no warnings 'unintialized';
>
> > Replace this : my $came_from = $ENV{'HTTP_REFERER'};
>> with : my $came_from = 'I must learn proper CGI programming
first';
>
> and see if the warning disappears.
So what I did was shorten the code, to makefinding this warning more
managable. It is listed below at ***.
But even after changing:
my $came_from = $ENV{'HTTP_REFERER'};
to:
my $came_from = 'You need to learn to be nicer to others';
the warning still occured.
So it's down to what is below, and I finally found the one line I can
comment IN or OUT, and cause the warning to disappear. Essentially, if I
comment out the SECOND line in:
my $ema = "";
$ema = $q->param('email');
then the warning diappears. Which means I really have to ask what is going
on here, because now I am really confused.
As for,
>>>I will also suggest, at the very least, that you use HTML::Template with
your scripts.
Am just curious, for writing small HTML output with my Perl scriptts, which
is why I am trying to do it this way. Is that considered ok? Or must I use
HTML::Template? Am I that wrong in attempting this way?
Thanks again,
Daniel
*** code
#!/usr/bin/perl
use warnings;
use strict;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
my $q = new CGI;
my $out = "Hello";
my $ema = "";
$ema = $q->param('email');
PrintSurvey();
print $q->header();
print $out;
exit 0;
sub PrintSurvey
{
$out = qq^
<HTML>
<HEAD>
<TITLE>Closet Music Survey</TITLE>
</HEAD>
<body bgcolor="#EEEEFF" text="#000000" link="#0000FF" vlink="#660033"
background="">
<FORM name="MusicSurvey" enctype="multipart/form-data"
action="http://www.fourgauchos.com/cgi-bin/recordsurvey_4.pl" method="POST">
<table border="0" CELLPADDING="5">
<tr><td colspan="2"> </td></tr>
<tr>
<td>
<input type="text" name="email" value="^ . $ema . qq^" maxlength=64
size = 32>
</td>
</tr>
<tr><td colspan="2"> </td></tr>
</table>
<INPUT type="submit" value="submit">
</form>
</body>
</html>^;
}
.
- Follow-Ups:
- Re: Use of uninitialized value Error
- From: daniel kaplan
- Re: Use of uninitialized value Error
- From: A. Sinan Unur
- Re: Use of uninitialized value Error
- References:
- Re: Use of uninitialized value Error
- From: A. Sinan Unur
- Re: Use of uninitialized value Error
- Prev by Date: Re: Best Linux distro for range of Perl modules
- Next by Date: FAQ 4.22 How do I expand function calls in a string?
- Previous by thread: Re: Use of uninitialized value Error
- Next by thread: Re: Use of uninitialized value Error
- Index(es):
Relevant Pages
|