Here's my relevant code, and here's the warning message that the script generates:
Use of uninitialized value in concatenation (.) or string at C:\ABG_kappaeta\mailer.pl line 19.
The code actually works (it doesn't stall like a full-blown error), but I still get that warning. Why? Am I practicing a bad way of doing something that should really be done another way?
Thanks.
Use of uninitialized value in concatenation (.) or string at C:\ABG_kappaeta\mailer.pl line 19.
Code:
#! /usr/bin/perl
print "Content-type: text/html\n\n";
my %FORM;
if ($ENV{'REQUEST_METHOD'} eq 'POST') {
read(STDIN, my $buffer, $ENV{'CONTENT_LENGTH'});
my @pairs = split(/&/,$buffer);
foreach my $pair(@pairs) {
(my $name, my $value) = split(/=/,$pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
}
print <<ENDHTML;
<HTML>
<HEAD>
<TITLE>Mailer Thingy</TITLE>
</HEAD>
<BODY>
Name: $FORM{name} <br />
E-mail Address: $FORM{email} <br />
Graduation Year: $FORM{year} <br />
Doing Now: $FORM{doingnow} <br />
Comments: $FORM{comments} <br />
</BODY>
</HTML>
ENDHTML
# exit
exit();
The code actually works (it doesn't stall like a full-blown error), but I still get that warning. Why? Am I practicing a bad way of doing something that should really be done another way?
Thanks.