Use of uninitialized value in string Where is mistake?
else{
print $q->param('test_name');
my $age = $q->param('age');
print "Возраст: $age";
}
Use of uninitialized value in string Where is mistake?
else{
print $q->param('test_name');
my $age = $q->param('age');
print "Возраст: $age";
}
You should include the full error message in your posts.
The following script will output two warnings:
use strict;
use warnings;
print undef;
my $age = undef;
print "Label: $age";
Outputs:
Use of uninitialized value in print at script.pl line 4.
Use of uninitialized value $age in concatenation (.) or string at script.pl line 8.
Label:
As you can observe, if your warning is about an uninitialized value in a print
, then test_name is not defined. If it's about an uninitialized value in concatenation
, then age is not defined.
Additionally, your warning messages should state the exact line number that it is referring to. Even if you don't understand the precise meaning of a warning, this tells you where to look.
This error (based on the code you posted) would indicate that there is no parameter being sent to the script named either of test_name
or age
.